From 3bb0c8068629b456eb8d9f979dbd85be1bddcfe2 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 8 Sep 2016 16:52:45 -0700 Subject: [PATCH] scoutfs: fix buddy stable bit test The buddy allocator had the test for non-existant stable bitmap blocks backwards. An uninitialized block implies that all the bits are marked free and we don't need to test that the specific bits are free. Signed-off-by: Zach Brown --- kmod/src/buddy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/src/buddy.c b/kmod/src/buddy.c index bc4f843c..96f3048f 100644 --- a/kmod/src/buddy.c +++ b/kmod/src/buddy.c @@ -388,7 +388,7 @@ static int find_first_fit(struct scoutfs_super_block *super, int sl, made_progress = true; /* advance to next bit if it's not free in stable */ - if (!st_bud || + if (st_bud && !test_buddy_bit_or_higher(st_bud, i, nr)) { nrs[i] = nr + 1; continue;