diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-01-23 20:28:59 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:49 -0400 |
commit | db36c1477d1753f4d5bebaed074ca4e4477df3ea (patch) | |
tree | 1dee5a2d6cb11a091b0d40137822835d1e1cf828 /fs/bcachefs/alloc_foreground.c | |
parent | 9fea089a9502784f42868b2649a732724f4c1d0b (diff) | |
download | linux-stable-db36c1477d1753f4d5bebaed074ca4e4477df3ea.tar.gz linux-stable-db36c1477d1753f4d5bebaed074ca4e4477df3ea.tar.bz2 linux-stable-db36c1477d1753f4d5bebaed074ca4e4477df3ea.zip |
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.c | 5 |
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, |