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 <mmpgouride@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Alan Huang 2025-06-25 03:10:27 +08:00 committed by Kent Overstreet
parent 72c0d9cb0f
commit 5c4acbc8ce

View File

@ -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) {