mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 18:56:24 +00:00
bcachefs: Fix for_each_btree_key2()
Previously, when we exited from the loop body with a break statement _ret wouldn't have been assigned to yet, and we could spuriously return a transaction restart error. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
4fcdd6ec34
commit
3bce138373
@ -490,11 +490,11 @@ __bch2_btree_iter_peek_and_restart(struct btree_trans *trans,
|
||||
\
|
||||
while (1) { \
|
||||
u32 _restart_count = bch2_trans_begin(_trans); \
|
||||
\
|
||||
_ret = 0; \
|
||||
(_k) = bch2_btree_iter_peek_type(&(_iter), (_flags)); \
|
||||
if (!(_k).k) { \
|
||||
_ret = 0; \
|
||||
if (!(_k).k) \
|
||||
break; \
|
||||
} \
|
||||
\
|
||||
_ret = bkey_err(_k) ?: (_do); \
|
||||
if (bch2_err_matches(_ret, BCH_ERR_transaction_restart))\
|
||||
|
Loading…
x
Reference in New Issue
Block a user