kernel_samsung_a53x/fs/ext4
zhanchengbin 9a68c22120 ext4: fix inode tree inconsistency caused by ENOMEM
commit 3f5424790d4377839093b68c12b130077a4e4510 upstream.

If ENOMEM fails when the extent is splitting, we need to restore the length
of the split extent.
In the ext4_split_extent_at function, only in ext4_ext_create_new_leaf will
it alloc memory and change the shape of the extent tree,even if an ENOMEM
is returned at this time, the extent tree is still self-consistent, Just
restore the split extent lens in the function ext4_split_extent_at.

ext4_split_extent_at
 ext4_ext_insert_extent
  ext4_ext_create_new_leaf
   1)ext4_ext_split
     ext4_find_extent
   2)ext4_ext_grow_indepth
     ext4_find_extent

Signed-off-by: zhanchengbin <zhanchengbin1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230103022812.130603-1-zhanchengbin1@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Baokun Li <libaokun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-23 23:21:48 +01:00
..
acl.c
acl.h
balloc.c
bitmap.c
block_validity.c
dir.c
ext4.h
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h
extents.c ext4: fix inode tree inconsistency caused by ENOMEM 2024-11-23 23:21:48 +01:00
extents_status.c ext4: fix infinite loop when replaying fast_commit 2024-11-23 23:20:09 +01:00
extents_status.h
fast_commit.c
fast_commit.h
file.c ext4: dax: fix overflowing extents beyond inode size when partially writing 2024-11-23 23:21:47 +01:00
fsmap.c
fsmap.h
fsync.c
hash.c
ialloc.c ext4: avoid negative min_clusters in find_group_orlov() 2024-11-23 23:21:23 +01:00
indirect.c
inline.c ext4: return error on ext4_find_inline_entry 2024-11-23 23:21:23 +01:00
inode-test.c
inode.c ext4: fix incorrect tid assumption in ext4_wait_for_tail_page_commit() 2024-11-23 23:21:44 +01:00
ioctl.c
Kconfig
Makefile
mballoc.c ext4: clear EXT4_GROUP_INFO_WAS_TRIMMED_BIT even mount with discard 2024-11-23 23:21:23 +01:00
mballoc.h
migrate.c ext4: fix i_data_sem unlock order in ext4_ind_migrate() 2024-11-23 23:21:42 +01:00
mmp.c
move_extent.c ext4: update orig_path in ext4_find_extent() 2024-11-23 23:21:44 +01:00
namei.c ext4: no need to continue when the number of entries is 1 2024-11-23 23:21:43 +01:00
page-io.c ext4: handle redirtying in ext4_bio_write_page() 2024-11-23 23:20:59 +01:00
readpage.c
resize.c
super.c ext4: fix error code saved on super block during file system abort 2024-11-19 14:19:51 +01:00
symlink.c
sysfs.c
truncate.h
verity.c
xattr.c ext4: avoid writing unitialized memory to disk in EA inodes 2024-11-23 23:20:10 +01:00
xattr.h
xattr_hurd.c
xattr_security.c
xattr_trusted.c
xattr_user.c