OSDN Git Service

ext4: fix error handling in ext4_fc_record_modified_inode()
authorRitesh Harjani <riteshh@linux.ibm.com>
Mon, 17 Jan 2022 12:11:49 +0000 (17:41 +0530)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 3 Feb 2022 15:57:30 +0000 (10:57 -0500)
commitcdce59a1549190b66f8e3fe465c2b2f714b98a94
tree17aaf70e4232357512cacbea8ff9b74cd51decb9
parent09355d9d038a1590ee055831a4ad3a79952cfa8b
ext4: fix error handling in ext4_fc_record_modified_inode()

Current code does not fully takes care of krealloc() error case, which
could lead to silent memory corruption or a kernel bug.  This patch
fixes that.

Also it cleans up some duplicated error handling logic from various
functions in fast_commit.c file.

Reported-by: luo penghao <luo.penghao@zte.com.cn>
Suggested-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/62e8b6a1cce9359682051deb736a3c0953c9d1e9.1642416995.git.riteshh@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
fs/ext4/fast_commit.c