Skip to content

Commit ec35b30

Browse files
author
Kent Overstreet
committed
bcachefs: Fix lost transaction restart error
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent a586036 commit ec35b30

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

fs/bcachefs/alloc_foreground.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,15 +1356,17 @@ int bch2_alloc_sectors_start_trans(struct btree_trans *trans,
13561356

13571357
/* Don't retry from all devices if we're out of open buckets: */
13581358
if (bch2_err_matches(ret, BCH_ERR_open_buckets_empty)) {
1359-
int ret = open_bucket_add_buckets(trans, &ptrs, wp, devs_have,
1359+
int ret2 = open_bucket_add_buckets(trans, &ptrs, wp, devs_have,
13601360
target, erasure_code,
13611361
nr_replicas, &nr_effective,
13621362
&have_cache, watermark,
13631363
flags, cl);
1364-
if (!ret ||
1365-
bch2_err_matches(ret, BCH_ERR_transaction_restart) ||
1366-
bch2_err_matches(ret, BCH_ERR_open_buckets_empty))
1364+
if (!ret2 ||
1365+
bch2_err_matches(ret2, BCH_ERR_transaction_restart) ||
1366+
bch2_err_matches(ret2, BCH_ERR_open_buckets_empty)) {
1367+
ret = ret2;
13671368
goto alloc_done;
1369+
}
13681370
}
13691371

13701372
/*

0 commit comments

Comments
 (0)