]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
bcachefs: Don't unlock the trans if ret doesn't match BCH_ERR_operation_blocked
authorAlan Huang <mmpgouride@gmail.com>
Tue, 24 Jun 2025 19:10:27 +0000 (03:10 +0800)
committerKent Overstreet <kent.overstreet@linux.dev>
Tue, 24 Jun 2025 19:46:59 +0000 (15:46 -0400)
Reported-by: syzbot+d540192e763531d307ff@syzkaller.appspotmail.com
Signed-off-by: Alan Huang <mmpgouride@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_update_interior.c

index 7bf1bd6a6e928677370c5a8d4930b3f2151715e7..553059b33bfd62c5c306bf4a0335d41c79e86e01 100644 (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) {