acrn-kernel/fs/nilfs2
Ryusuke Konishi 13f79a0026 nilfs2: replace WARN_ONs for invalid DAT metadata block requests
commit 5124a0a549 upstream.

If DAT metadata file block access fails due to corruption of the DAT file
or abnormal virtual block numbers held by b-trees or inodes, a kernel
warning is generated.

This replaces the WARN_ONs by error output, so that a kernel, booted with
panic_on_warn, does not panic.  This patch also replaces the detected
return code -ENOENT with another internal code -EINVAL to notify the bmap
layer of metadata corruption.  When the bmap layer sees -EINVAL, it
handles the abnormal situation with nilfs_bmap_convert_error() and finally
returns code -EIO as it should.

Link: https://lkml.kernel.org/r/0000000000005cc3d205ea23ddcf@google.com
Link: https://lkml.kernel.org/r/20230126164114.6911-1-konishi.ryusuke@gmail.com
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Reported-by: <syzbot+5d5d25f90f195a3cfcb4@syzkaller.appspotmail.com>
Tested-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 09:12:52 +01:00
..
Kconfig
Makefile
alloc.c
alloc.h
bmap.c
bmap.h
btnode.c
btnode.h
btree.c
btree.h
cpfile.c
cpfile.h
dat.c nilfs2: replace WARN_ONs for invalid DAT metadata block requests 2024-02-23 09:12:52 +01:00
dat.h
dir.c
direct.c
direct.h
export.h
file.c nilfs2: fix hang in nilfs_lookup_dirty_data_buffers() 2024-02-23 09:12:44 +01:00
gcinode.c
ifile.c
ifile.h
inode.c
ioctl.c
mdt.c
mdt.h
namei.c
nilfs.h
page.c
page.h
recovery.c nilfs2: fix data corruption in dsync block recovery for small block sizes 2024-02-23 09:12:44 +01:00
segbuf.c
segbuf.h
segment.c nilfs2: fix potential bug in end_buffer_async_write 2024-02-23 09:12:52 +01:00
segment.h
sufile.c
sufile.h
super.c
sysfs.c
sysfs.h
the_nilfs.c
the_nilfs.h