[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240701143606.3904202-1-lizhi.xu@windriver.com>
Date: Mon, 1 Jul 2024 22:36:06 +0800
From: Lizhi Xu <lizhi.xu@...driver.com>
To: <syzbot+8996d8f176cf946ef641@...kaller.appspotmail.com>
CC: <bfoster@...hat.com>, <kent.overstreet@...ux.dev>,
<linux-bcachefs@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<syzkaller-bugs@...glegroups.com>
Subject: [PATCH] bcachefs: fix hung in bch2_fs_read_only_work
Error logs:
[ T5078] invalid journal entry, version=1.7: mi_btree_bitmap type=btree_keys in superblock: k->u64s 0, shutting down
[ T5078] invalid journal entry, version=1.7: mi_btree_bitmap type=btree_keys in superblock: k->u64s 0, shutting down
[ T5078] invalid journal entry, version=1.7: mi_btree_bitmap type=btree_keys in superblock: k->u64s 0, shutting down
When hit -BCH_ERR_fsck_errors_not_fixed in journal_entry_err, it will make
journal_entry_btree_keys_validate output too many same error log, and it will block
bch2_fs_start to release state_lock.
Reported-and-tested-by: syzbot+8996d8f176cf946ef641@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=8996d8f176cf946ef641
Signed-off-by: Lizhi Xu <lizhi.xu@...driver.com>
---
fs/bcachefs/journal_io.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c
index 492426c8d869..67c3f09162e4 100644
--- a/fs/bcachefs/journal_io.c
+++ b/fs/bcachefs/journal_io.c
@@ -415,6 +415,8 @@ static int journal_entry_btree_keys_validate(struct bch_fs *c,
flags|BCH_VALIDATE_journal);
if (ret == FSCK_DELETED_KEY)
continue;
+ else if (ret == -BCH_ERR_fsck_errors_not_fixed)
+ break;
k = bkey_next(k);
}
--
2.43.0
Powered by blists - more mailing lists