[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250627084033.614376-2-bharadwaj.raju777@gmail.com>
Date: Fri, 27 Jun 2025 14:10:32 +0530
From: Bharadwaj Raju <bharadwaj.raju777@...il.com>
To: kent.overstreet@...ux.dev
Cc: Bharadwaj Raju <bharadwaj.raju777@...il.com>,
linux-bcachefs@...r.kernel.org,
shuah@...nel.org,
linux-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linux.dev,
syzbot+029d1989099aa5ae3e89@...kaller.appspotmail.com
Subject: [PATCH] bcachefs: use mustfix to check invalid btree IDs
Checking for invalid IDs was introduced in 9e7cfb35e266 ("bcachefs: Check for invalid btree IDs")
to prevent an invalid shift later, but since 141526548052 ("bcachefs: Bad btree roots are now autofix")
made the parent class btree_root_bkey_invalid FSCK_AUTOFIX, fsck_err_on
no longer works for this check.
Change the condition to use mustfix_fsck_err_on instead.
Reported-by: syzbot+029d1989099aa5ae3e89@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=029d1989099aa5ae3e89
Fixes: 141526548052 ("bcachefs: Bad btree roots are now autofix")
Signed-off-by: Bharadwaj Raju <bharadwaj.raju777@...il.com>
---
fs/bcachefs/recovery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index d0b7e3a36a54..abcaa0e3e2e6 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -489,7 +489,7 @@ static int journal_replay_entry_early(struct bch_fs *c,
if (unlikely(!entry->u64s))
return 0;
- if (fsck_err_on(entry->btree_id >= BTREE_ID_NR_MAX,
+ if (mustfix_fsck_err_on(entry->btree_id >= BTREE_ID_NR_MAX,
c, invalid_btree_id,
"invalid btree id %u (max %u)",
entry->btree_id, BTREE_ID_NR_MAX))
--
2.50.0
Powered by blists - more mailing lists