[Dovecot] Cannot remove Maildir folder

Marcin Deranek marcin at ripe.net
Wed May 31 11:11:34 EEST 2006


Hi Timo,

Marcin Deranek wrote:

> Yes, default is 5. I'll try to set it to 1 and see if it helps.

It doesn't help, but I found the problem..

Short story: files dovecot.index, dovecot.index.log and
dovecot.index.cache are unlinked before they are closed..
close-before-unlink should fix the problem for NFS.

Long story:
* Just before removal:
|fd|path|
10 -> /home/marcin/Maildir/.Trash.test/dovecot.index.cache
8 -> /home/marcin/Maildir/.Trash.test/dovecot.index
9 -> /home/marcin/Maildir/.Trash.test/dovecot.index.log

* strace
bash$ egrep '^(rmdir|unlink|close)' /tmp/out.txt
close(12)                               = 0
close(11)                               = 0
close(11)                               = 0
unlink("cur")                           = -1 EISDIR (Is a directory)
close(14)                               = 0
close(15)                               = 0
rmdir("cur")                            = 0
unlink("new")                           = -1 EISDIR (Is a directory)
close(14)                               = 0
close(15)                               = 0
rmdir("new")                            = 0
unlink("tmp")                           = -1 EISDIR (Is a directory)
close(14)                               = 0
close(15)                               = 0
rmdir("tmp")                            = 0
unlink("dovecot.index.log")             = 0
unlink("dovecot.index")                 = 0
unlink("dovecot.index.cache")           = 0
unlink(".nfs008b830b0002e5f4")          = -1 EBUSY (Device or resource busy)


* Just after
|fd|path|
10 -> /home/marcin/Maildir/..DOVECOT-TRASHED/.nfs008b830d0002e5f6
8 -> /home/marcin/Maildir/..DOVECOT-TRASHED/.nfs008b83100002e5f5
9 -> /home/marcin/Maildir/..DOVECOT-TRASHED/.nfs008b830b0002e5f4

It seems when you unlink the file, before you close it causes NFS client
to rename the file to .nfsXXX even if both operations were done by the
very same process (tested with simple C program). In strace output I do
not see any close(8-10), so files were opened when they were unlinked.
I hope we can do something about it :-))
Cheers,

Marcin

P.S.
Even with Thunderbird using 5 IMAP connections seems like all requests
to single folder are handled by a single imap process.


More information about the dovecot mailing list