linux/fs/ext4
Theodore Ts'o d8b7689a62 ext4: fix potential htree index checksum corruption
[ Upstream commit b5776e7524afbd4569978ff790864755c438bba7 ]

In the case where we need to do an interior node split, and
immediately afterwards, we are unable to allocate a new directory leaf
block due to ENOSPC, the directory index checksum's will not be filled
in correctly (and indeed, will not be correctly journalled).

This looks like a bug that was introduced when we added largedir
support.  The original code doesn't make any sense (and should have
been caught in code review), but it was hidden because most of the
time, the index node checksum will be set by do_split().  But if
do_split bails out due to ENOSPC, then ext4_handle_dirty_dx_node()
won't get called, and so the directory index checksum field will not
get set, leading to:

EXT4-fs error (device sdb): dx_probe:858: inode #6635543: block 4022: comm nfsd: Directory index failed checksum

Google-Bug-Id: 176345532
Fixes: e08ac99fa2 ("ext4: add largedir feature")
Cc: Artem Blagodarenko <artem.blagodarenko@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-04 10:26:37 +01:00
..
acl.c
acl.h
balloc.c
bitmap.c
block_validity.c
dir.c
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h
ext4.h ext4: fix bogus warning in ext4_update_dx_flag() 2020-11-24 13:29:21 +01:00
extents_status.c
extents_status.h
extents.c
file.c ext4: don't leak old mountpoint samples 2021-01-19 18:26:13 +01:00
fsmap.c ext4: limit entries returned when counting fsmap records 2020-10-29 09:57:55 +01:00
fsmap.h
fsync.c
hash.c
ialloc.c
indirect.c
inline.c ext4: unlock xattr_sem properly in ext4_inline_data_truncate() 2020-11-18 19:20:28 +01:00
inode.c writeback: Drop I_DIRTY_TIME_EXPIRE 2021-01-30 13:54:11 +01:00
ioctl.c ext4: fix superblock checksum failure when setting password salt 2021-01-19 18:26:17 +01:00
Kconfig
Makefile
mballoc.c ext4: fix a memory leak of ext4_free_data 2020-12-30 11:51:37 +01:00
mballoc.h
migrate.c
mmp.c
move_extent.c
namei.c ext4: fix potential htree index checksum corruption 2021-03-04 10:26:37 +01:00
page-io.c
readpage.c
resize.c ext4: fix error handling code in add_new_gdb 2020-11-05 11:43:35 +01:00
super.c ext4: don't remount read-only with errors=continue on reboot 2021-01-06 14:48:36 +01:00
symlink.c
sysfs.c
truncate.h
verity.c
xattr_security.c
xattr_trusted.c
xattr_user.c
xattr.c
xattr.h