More Skiplist Stuff!

Bron Gondwana brong at fastmail.fm
Sun Dec 30 22:10:49 EST 2007


On Sun, Dec 30, 2007 at 11:38:36PM +1100, Bron Gondwana wrote:
> I have much bigger fish to fry here, mailboxes.db corruptions again
> indeed.  I've seen a couple of them over the past few days, with
> behaviour that looks remarkably like it might be a Linux kernel bug
> with mmap, seek and file ends.  Arrgh.

Ho hum - there's also this little bit of trouble with the 
SAFE_TO_APPEND code that I discovered reading the code again.
I don't know if this can explain everything, but it is still
worth fixing.

Basically, if you hand a pointer to a null transaction to one
of the read functions (myfetch, myforeach) then it locks the
file in write mode and begins a new transaction... but it
doesn't check SAFE_TO_APPEND.

Later you do a write, and it still doesn't check SAFE_TO_APPEND
because it already has a transaction.

This patch fixes the problem by moving the SAFE_TO_APPEND check
into newtxn so it gets called from all codepaths that start a
new transaction.

Bron.

http://cyrus.brong.fastmail.fm/patches/cyrus-skiplist-safelock-2.3.11.diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cyrus-skiplist-safelock-2.3.11.diff
Type: text/x-diff
Size: 2392 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20071231/2a617328/attachment.bin 


More information about the Cyrus-devel mailing list