]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nilfs2: fix kernel bug due to missing clearing of buffer delay flag
authorRyusuke Konishi <konishi.ryusuke@gmail.com>
Tue, 15 Oct 2024 21:32:07 +0000 (06:32 +0900)
committerChristian Brauner <brauner@kernel.org>
Wed, 16 Oct 2024 13:05:32 +0000 (15:05 +0200)
commit6ed469df0bfbef3e4b44fca954a781919db9f7ab
tree283a2688635cf13abc510f97f44c118a8154484c
parentf92f0a1b05698340836229d791b3ffecc71b265a
nilfs2: fix kernel bug due to missing clearing of buffer delay flag

Syzbot reported that after nilfs2 reads a corrupted file system image
and degrades to read-only, the BUG_ON check for the buffer delay flag
in submit_bh_wbc() may fail, causing a kernel bug.

This is because the buffer delay flag is not cleared when clearing the
buffer state flags to discard a page/folio or a buffer head. So, fix
this.

This became necessary when the use of nilfs2's own page clear routine
was expanded.  This state inconsistency does not occur if the buffer
is written normally by log writing.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Link: https://lore.kernel.org/r/20241015213300.7114-1-konishi.ryusuke@gmail.com
Fixes: 8c26c4e2694a ("nilfs2: fix issue with flush kernel thread after remount in RO mode because of driver's internal error or metadata corruption")
Reported-by: syzbot+985ada84bf055a575c07@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=985ada84bf055a575c07
Cc: stable@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/nilfs2/page.c