From: Alan Huang Date: Tue, 24 Jun 2025 19:10:27 +0000 (+0800) Subject: bcachefs: Don't unlock the trans if ret doesn't match BCH_ERR_operation_blocked X-Git-Tag: v6.16-rc4~24^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c4acbc8ce9025fe6e318966af8d3c42ffc6e9ca;p=thirdparty%2Flinux.git bcachefs: Don't unlock the trans if ret doesn't match BCH_ERR_operation_blocked Reported-by: syzbot+d540192e763531d307ff@syzkaller.appspotmail.com Signed-off-by: Alan Huang Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c index 7bf1bd6a6e928..553059b33bfd6 100644 --- a/fs/bcachefs/btree_update_interior.c +++ b/fs/bcachefs/btree_update_interior.c @@ -1287,10 +1287,11 @@ bch2_btree_update_start(struct btree_trans *trans, struct btree_path *path, do { ret = bch2_btree_reserve_get(trans, as, nr_nodes, target, flags, &cl); - + if (!bch2_err_matches(ret, BCH_ERR_operation_blocked)) + break; bch2_trans_unlock(trans); bch2_wait_on_allocator(c, &cl); - } while (bch2_err_matches(ret, BCH_ERR_operation_blocked)); + } while (1); } if (ret) {