[Dovecot] Re: Maildir unreliability

Gregory Bond gnb at itga.com.au
Wed Oct 27 02:19:38 EEST 2004


Geo Carncross wrote:

>P1:	opendir(dir1)
>P1:	readdir()
>P2:	rename(dir1/f, dir1/f:2)
>P1:	readdir()		<- never sees dir1/f _OR_ dir1/f:2
>  
>

This is an artifact of the directory entry creation "find first fit" 
algorithm, and is likely to only be  a problem on directories of > 1 
block in size (so the readdir is not atomic), with lots of deletes and 
renames (so lots of free space at the front of the directory).  Like, 
oh, for example, large active Maildir folders.   And it would only 
happen when renaming to longer names (and hence moving the directory 
entry around); shortening the name or editing it would (usually!) happen 
in-place.

Fixing this in general is going to need serious kernel hacking is likely 
to be very hard, and have ugly performance or  space tradeoffs.

Hmmm.... dunno if this is acceptable for Maildir, but can you pad the 
filenames somehow so that the renames never lengthen the filename?



More information about the dovecot mailing list