From 2ecf943a99c427b10a998f0285dd184b1a25ac65 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 17 Nov 2010 20:30:07 +1030 Subject: [PATCH 1/1] tdb2: fix bucket search We were previously jumping straight from the first bucket to the end. --- ccan/tdb2/free.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccan/tdb2/free.c b/ccan/tdb2/free.c index 48cd9c31..f5107fad 100644 --- a/ccan/tdb2/free.c +++ b/ccan/tdb2/free.c @@ -559,7 +559,7 @@ static tdb_off_t get_free(struct tdb_context *tdb, b = size_to_bucket(tdb->zhdr.zone_bits, size); for (b = find_free_head(tdb, b); b <= BUCKETS_FOR_ZONE(tdb->zhdr.zone_bits); - b += find_free_head(tdb, b + 1)) { + b = find_free_head(tdb, b + 1)) { /* Try getting one from list. */ off = lock_and_alloc(tdb, tdb->zone_off, tdb->zhdr.zone_bits, -- 2.39.2