diff options
author | Zhang Yi <yi.zhang@huawei.com> | 2021-08-26 16:04:09 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2021-08-31 06:36:51 +0300 |
commit | baaae979b112642a41b71c71c599d875c067d257 (patch) | |
tree | edac645fc9e68e56f616671022284a916f1857e4 /fs/ext4/ioctl.c | |
parent | 8e33fadf945a918c50d92fab6a769661df484156 (diff) | |
download | linux-baaae979b112642a41b71c71c599d875c067d257.tar.xz |
ext4: make the updating inode data procedure atomic
Now that ext4_do_update_inode() return error before filling the whole
inode data if we fail to set inode blocks in ext4_inode_blocks_set().
This error should never happen in theory since sb->s_maxbytes should not
have allowed this, we have already init sb->s_maxbytes according to this
feature in ext4_fill_super(). So even through that could only happen due
to the filesystem corruption, we'd better to return after we finish
updating the inode because it may left an uninitialized buffer and we
could read this buffer later in "errors=continue" mode.
This patch make the updating inode data procedure atomic, call
EXT4_ERROR_INODE() after we dropping i_raw_lock after something bad
happened, make sure that the inode is integrated, and also drop a BUG_ON
and do some small cleanups.
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20210826130412.3921207-4-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ioctl.c')
0 files changed, 0 insertions, 0 deletions