tdb2: fix coalesce race #3
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 15 Nov 2010 07:25:45 +0000 (17:55 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 15 Nov 2010 07:25:45 +0000 (17:55 +1030)
commit06a5b1a852c207a5172922e39d8effab0dd17b91
tree782220775ea676cb201638886dc937e1053afa44
parent56ea2c52a18a41a88ceaed72aef56c10de85ce93
tdb2: fix coalesce race #3

When we're coalescing, we need to drop the lock on the current free list, as
we've enlarged the block and it may now belong in a different list.

Unfortunately (as shown by repeated tdbtorture -n 8) another coalescing run
can do the coalescing while we've dropped the lock.  So for this case, we
use the TDB_COALESCING_MAGIC flag so it doesn't look free.
ccan/tdb2/free.c