]> git.ozlabs.org Git - ccan/commit
tdb2: fix coalesce race #2
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 15 Nov 2010 08:32:42 +0000 (19:02 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 15 Nov 2010 08:32:42 +0000 (19:02 +1030)
commitd2a4d6b49bc260bd0979965f4e4ef62b40b19efe
treecf5f1d327e8ee7eeadf1015372802f06fd495997
parentb547900937973a8079101fe728e243ced3290caf
tdb2: fix coalesce race #2

When we find a free block, we need to mark it as used before we drop the
free lock, even though we've removed it from the list.  Otherwise the
coalescing code can find it.

This means handing the information we need down to lock_and_alloc, which
also means we know when we're grabbing a "growing" entry, and can relax
the heuristics about finding a good-sized block in that case.
ccan/tdb2/free.c