diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-21 19:10:40 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-21 19:10:40 -0500 |
commit | 93241a1c9a7dbef987f524a9dea3fc61e87e845b (patch) | |
tree | af89381c5c4c4938b03fe27b9d61e45e08f7432d /libbcachefs/alloc_foreground.c | |
parent | 2b97686ffa5f714a970ad88aa40cf47bdb998094 (diff) |
Update bcachefs sources to 5d0a6c2b32f1 bcachefs: check_directory_structure() can now be run online
Diffstat (limited to 'libbcachefs/alloc_foreground.c')
-rw-r--r-- | libbcachefs/alloc_foreground.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libbcachefs/alloc_foreground.c b/libbcachefs/alloc_foreground.c index 317391fe..cbd3032d 100644 --- a/libbcachefs/alloc_foreground.c +++ b/libbcachefs/alloc_foreground.c @@ -1360,8 +1360,17 @@ retry: goto alloc_done; /* Don't retry from all devices if we're out of open buckets: */ - if (bch2_err_matches(ret, BCH_ERR_open_buckets_empty)) - goto allocate_blocking; + if (bch2_err_matches(ret, BCH_ERR_open_buckets_empty)) { + int ret = open_bucket_add_buckets(trans, &ptrs, wp, devs_have, + target, erasure_code, + nr_replicas, &nr_effective, + &have_cache, watermark, + flags, cl); + if (!ret || + bch2_err_matches(ret, BCH_ERR_transaction_restart) || + bch2_err_matches(ret, BCH_ERR_open_buckets_empty)) + goto alloc_done; + } /* * Only try to allocate cache (durability = 0 devices) from the @@ -1375,7 +1384,6 @@ retry: &have_cache, watermark, flags, cl); } else { -allocate_blocking: ret = open_bucket_add_buckets(trans, &ptrs, wp, devs_have, target, erasure_code, nr_replicas, &nr_effective, |