aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <[email protected]>2023-01-23 20:28:59 -0500
committerKent Overstreet <[email protected]>2023-10-22 17:09:49 -0400
commitdb36c1477d1753f4d5bebaed074ca4e4477df3ea (patch)
tree1dee5a2d6cb11a091b0d40137822835d1e1cf828
parent9fea089a9502784f42868b2649a732724f4c1d0b (diff)
bcachefs: Fix bch2_bucket_alloc_early()
We were incorrectly retrying after a transaction restart. Signed-off-by: Kent Overstreet <[email protected]>
-rw-r--r--fs/bcachefs/alloc_foreground.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index 3219c37d9262..471ae15caa75 100644
--- a/fs/bcachefs/alloc_foreground.c
+++ b/fs/bcachefs/alloc_foreground.c
@@ -421,12 +421,15 @@ again:
ca->alloc_cursor = alloc_cursor;
+ if (!ob && ret)
+ ob = ERR_PTR(ret);
+
if (!ob && alloc_cursor > alloc_start) {
alloc_cursor = alloc_start;
goto again;
}
- return ob ?: ERR_PTR(ret ?: -BCH_ERR_no_buckets_found);
+ return ob;
}
static struct open_bucket *bch2_bucket_alloc_freelist(struct btree_trans *trans,