linux/fs/nilfs2
Ryusuke Konishi 111b812d36 nilfs2: determine empty node blocks as corrupted
Due to the nature of b-trees, nilfs2 itself and admin tools such as
mkfs.nilfs2 will never create an intermediate b-tree node block with 0
child nodes, nor will they delete (key, pointer)-entries that would result
in such a state.  However, it is possible that a b-tree node block is
corrupted on the backing device and is read with 0 child nodes.

Because operation is not guaranteed if the number of child nodes is 0 for
intermediate node blocks other than the root node, modify
nilfs_btree_node_broken(), which performs sanity checks when reading a
b-tree node block, so that such cases will be judged as metadata
corruption.

Link: https://lkml.kernel.org/r/20240904081401.16682-3-konishi.ryusuke@gmail.com
Fixes: 17c76b0104 ("nilfs2: B-tree based block mapping")
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: Lizhi Xu <lizhi.xu@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-09-09 16:47:42 -07:00
..
alloc.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-03 19:30:16 -07:00
alloc.h nilfs2: fix incorrect kernel-doc declaration of nilfs_palloc_req structure 2024-09-01 20:43:36 -07:00
bmap.c nilfs2: fix missing initial short descriptions of kernel-doc comments 2024-09-01 20:43:37 -07:00
bmap.h nilfs2: use the BITS_PER_LONG macro 2024-09-01 20:43:42 -07:00
btnode.c nilfs2: improve kernel-doc comments for b-tree node helpers 2024-09-01 20:43:36 -07:00
btnode.h fs/nilfs2: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:33 -06:00
btree.c nilfs2: determine empty node blocks as corrupted 2024-09-09 16:47:42 -07:00
btree.h nilfs2: add missing description of nilfs_btree_path structure 2024-09-01 20:43:36 -07:00
cpfile.c nilfs2: treat missing cpfile header block as metadata corruption 2024-09-01 20:43:39 -07:00
cpfile.h nilfs2: remove nilfs_cpfile_{get,put}_checkpoint() 2024-02-22 15:38:53 -08:00
dat.c nilfs2: fix missing initial short descriptions of kernel-doc comments 2024-09-01 20:43:37 -07:00
dat.h nilfs2: remove filenames from file comments 2021-11-09 10:02:52 -08:00
dir.c nilfs2: use common implementation of file type 2024-09-01 20:43:42 -07:00
direct.c nilfs2: fix failure to detect DAT corruption in btree and direct mappings 2024-03-14 09:17:29 -07:00
direct.h nilfs2: remove filenames from file comments 2021-11-09 10:02:52 -08:00
export.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
file.c nilfs2: fix hang in nilfs_lookup_dirty_data_buffers() 2024-02-07 21:20:36 -08:00
gcinode.c nilfs2: add kernel-doc comments to nilfs_remove_all_gcinodes() 2024-04-25 21:07:08 -07:00
ifile.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-03 19:30:16 -07:00
ifile.h nilfs2: localize highmem mapping for checkpoint reading within cpfile 2024-02-22 15:38:53 -08:00
inode.c nilfs2: do not repair reserved inode bitmap in nilfs_new_inode() 2024-09-01 20:43:43 -07:00
ioctl.c nilfs2: add missing argument descriptions for ioctl-related helpers 2024-09-01 20:43:35 -07:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mdt.c nilfs2: do not output warnings when clearing dirty buffers 2024-09-01 20:43:35 -07:00
mdt.h nilfs2: fix lockdep warnings during disk space reclamation 2022-04-01 11:46:09 -07:00
namei.c misc cleanups (the part that hadn't been picked by individual fs trees) 2024-01-11 20:23:50 -08:00
nilfs.h nilfs2: separate inode type information from i_state field 2024-09-01 20:43:43 -07:00
page.c nilfs2: do not output warnings when clearing dirty buffers 2024-09-01 20:43:35 -07:00
page.h nilfs2: do not output warnings when clearing dirty buffers 2024-09-01 20:43:35 -07:00
recovery.c nilfs2: do not propagate ENOENT error from sufile during recovery 2024-09-01 20:43:39 -07:00
segbuf.c nilfs2: convert segment buffer to use kmap_local 2024-02-22 15:38:53 -08:00
segbuf.h nilfs2: remove filenames from file comments 2021-11-09 10:02:52 -08:00
segment.c nilfs2: refactor nilfs_segctor_thread() 2024-09-01 20:43:44 -07:00
segment.h nilfs2: use kthread_create and kthread_stop for the log writer thread 2024-09-01 20:43:44 -07:00
sufile.c nilfs2: do not propagate ENOENT error from nilfs_sufile_mark_dirty() 2024-09-01 20:43:40 -07:00
sufile.h nilfs2: remove filenames from file comments 2021-11-09 10:02:52 -08:00
super.c nilfs2: separate inode type information from i_state field 2024-09-01 20:43:43 -07:00
sysfs.c nilfs2: Constify struct kobj_type 2024-07-12 16:39:52 -07:00
sysfs.h nilfs2: remove filenames from file comments 2021-11-09 10:02:52 -08:00
the_nilfs.c nilfs2: eliminate the shared counter and spinlock for i_generation 2024-09-01 20:43:43 -07:00
the_nilfs.h nilfs2: eliminate the shared counter and spinlock for i_generation 2024-09-01 20:43:43 -07:00