]> www.infradead.org Git - users/hch/dma-mapping.git/commitdiff
bcachefs: Fix __bch2_fsck_err() warning
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 19 Oct 2024 21:23:10 +0000 (17:23 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 20 Oct 2024 20:50:14 +0000 (16:50 -0400)
We only warn about having a btree_trans that wasn't passed in if we'll
be prompting.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/error.c

index 7a79f695ba2e749bbcb352864028c8ff9f51736f..b679def8fb98c7c94b70bb18b43b1b1600df1f4d 100644 (file)
@@ -251,7 +251,10 @@ int __bch2_fsck_err(struct bch_fs *c,
         *   delete the key)
         * - and we don't need to warn if we're not prompting
         */
-       WARN_ON(!(flags & FSCK_AUTOFIX) && !trans && bch2_current_has_btree_trans(c));
+       WARN_ON((flags & FSCK_CAN_FIX) &&
+               !(flags & FSCK_AUTOFIX) &&
+               !trans &&
+               bch2_current_has_btree_trans(c));
 
        if ((flags & FSCK_CAN_FIX) &&
            test_bit(err, c->sb.errors_silent))