Skip to contentSkip to conversation

bcachefs: Fix __bch2_fsck_err() warning

PATCH New Kent Overstreet 1 participant 1 message Oct 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcachefs: Fix __bch2_fsck_err() warning

We only warn about having a btree_trans that wasn't passed in if we'll be prompting.

---
 fs/bcachefs/error.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
fs/bcachefs/error.c +4 -1
index 7a79f695ba2e..b679def8fb98 100644
@@ -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))
Signature · 1 line
2.45.2