summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_foreground.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-01-24 04:28:59 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:49 +0300
commitdb36c1477d1753f4d5bebaed074ca4e4477df3ea (patch)
tree1dee5a2d6cb11a091b0d40137822835d1e1cf828 /fs/bcachefs/alloc_foreground.c
parent9fea089a9502784f42868b2649a732724f4c1d0b (diff)
downloadlinux-db36c1477d1753f4d5bebaed074ca4e4477df3ea.tar.xz
bcachefs: Fix bch2_bucket_alloc_early()
We were incorrectly retrying after a transaction restart. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_foreground.c')
-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,