summaryrefslogtreecommitdiffstats
path: root/fs/ext4/inline.c
diff options
context:
space:
mode:
authorZhang Yi <yi.zhang@huawei.com>2021-07-16 20:20:21 +0800
committerTheodore Ts'o <tytso@mit.edu>2021-09-04 23:38:18 -0400
commit4df031ff5876d94b48dd9ee486ba5522382a06b2 (patch)
tree52c453e2978abff4caf9c5218e68681619867251 /fs/ext4/inline.c
parentb33d9f5909c8d30f1429fb9aefbb32760901a023 (diff)
downloadlinux-4df031ff5876d94b48dd9ee486ba5522382a06b2.tar.bz2
ext4: check and update i_disksize properly
After commit 3da40c7b0898 ("ext4: only call ext4_truncate when size <= isize"), i_disksize could always be updated to i_size in ext4_setattr(), and we could sure that i_disksize <= i_size since holding inode lock and if i_disksize < i_size there are delalloc writes pending in the range upto i_size. If the end of the current write is <= i_size, there's no need to touch i_disksize since writeback will push i_disksize upto i_size eventually. So we can switch to check i_size instead of i_disksize in ext4_da_write_end() when write to the end of the file. we also could remove ext4_mark_inode_dirty() together because we defer inode dirtying to generic_write_end() or ext4_da_write_inline_data_end(). Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Link: https://lore.kernel.org/r/20210716122024.1105856-2-yi.zhang@huawei.com
Diffstat (limited to 'fs/ext4/inline.c')
0 files changed, 0 insertions, 0 deletions