aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/fast_commit.c
diff options
context:
space:
mode:
authorBaokun Li <[email protected]>2024-10-08 12:11:52 +0000
committerTheodore Ts'o <[email protected]>2024-11-13 04:49:55 +0000
commit40eb3104cf416188c4bd8fd7946f6c388409c286 (patch)
tree77b1fafd5c5e3d2d1c087830e6bac759450148e3 /fs/ext4/fast_commit.c
parentext4: show the default enabled prefetch_block_bitmaps option (diff)
downloadkernel-40eb3104cf416188c4bd8fd7946f6c388409c286.tar.gz
kernel-40eb3104cf416188c4bd8fd7946f6c388409c286.zip
ext4: WARN if a full dir leaf block has only one dentry
The maximum length of a filename is 255 and the minimum block size is 1024, so it is always guaranteed that the number of entries is greater than or equal to 2 when do_split() is called. So unless ext4_dx_add_entry() and make_indexed_dir() or some other functions are buggy, 'split == 0' will not occur. Setting 'continued' to 0 in this case masks the problem that the file system has become corrupted, even though it prevents possible out-of-bounds access. Hence WARN_ON_ONCE() is used to check if 'split' is 0, and if it is then warns and returns an error to abort split. Suggested-by: Theodore Ts'o <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Baokun Li <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
Diffstat (limited to 'fs/ext4/fast_commit.c')
0 files changed, 0 insertions, 0 deletions