[Dovecot] pre-1.0.rc27: Index and mbox fixes

Timo Sirainen tss at iki.fi
Sun Mar 11 21:45:08 EET 2007


On Sun, 2007-03-11 at 21:32 +0200, Timo Sirainen wrote:
> 1. write mails to tmp/
> 2. lock dovecot-uidlist file
> 3. rename() mails from tmp/ to new/
> 4. write the new dovecot-uidlist's contents to dovecot-uidlist.lock
> 5. rename() dovecot-uidlist.lock to dovecot-uidlist
> 
> If I switched 3 and 4, there are only rename()s that can fail. 

And I of course mean that if writing dovecot-uidlist.lock fails, the
whole mail saving is aborted with "ouf of disk space" error, even though
the mail file itself was successfully saved to tmp.

> And at
> least my Linux allows rename()ing when there's no disk space left. I
> hope that's the case for "out of quota" conditions too? Or does it
> create a new directory entry which can in some situations cause a new
> disk block allocation which will fail?..

rename()s from tmp/ to new/ can at least fail. But if that happens the
whole transaction can again be aborted and all the mails unlink()ed
(even the ones already in new/. that's how it currently works too).

So the only problem is if the last uidlist rename() fails. But that I
hope won't fail because it's done inside the same directory, and the
maildir root directory is pretty static.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070311/68614378/attachment.pgp 


More information about the dovecot mailing list