diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-01-23 20:28:59 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-03 21:48:50 -0500 |
commit | 08ce9f6feb1c8963dd22a3218e9591a57467da0d (patch) | |
tree | 83fbfcc2052ab7b61833293d8a10d90aa204e69d | |
parent | 7787a231a0ad8508e086cb62e9e2c8e4643a1f62 (diff) |
bcachefs: Fix bch2_bucket_alloc_early()
We were incorrectly retrying after a transaction restart.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-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 243386b71b58..eaea701c22fd 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, |