kernel_samsung_a53x/fs/ext4
Jan Kara 8d891d670a ext4: properly sync file size update after O_SYNC direct IO
[ Upstream commit 91562895f8030cb9a0470b1db49de79346a69f91 ]

Gao Xiang has reported that on ext4 O_SYNC direct IO does not properly
sync file size update and thus if we crash at unfortunate moment, the
file can have smaller size although O_SYNC IO has reported successful
completion. The problem happens because update of on-disk inode size is
handled in ext4_dio_write_iter() *after* iomap_dio_rw() (and thus
dio_complete() in particular) has returned and generic_file_sync() gets
called by dio_complete(). Fix the problem by handling on-disk inode size
update directly in our ->end_io completion handler.

References: https://lore.kernel.org/all/02d18236-26ef-09b0-90ad-030c4fe3ee20@linux.alibaba.com
Reported-by: Gao Xiang <hsiangkao@linux.alibaba.com>
CC: stable@vger.kernel.org
Fixes: 378f32bab371 ("ext4: introduce direct I/O write using iomap infrastructure")
Signed-off-by: Jan Kara <jack@suse.cz>
Tested-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/20231013121350.26872-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Stable-dep-of: dda898d7ffe8 ("ext4: dax: fix overflowing extents beyond inode size when partially writing")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:21:47 +01:00
..
acl.c
acl.h ext4: apply umask if ACL support is disabled 2024-11-18 11:43:31 +01:00
balloc.c
bitmap.c
block_validity.c
dir.c
ext4.h
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h
extents.c ext4: update orig_path in ext4_find_extent() 2024-11-23 23:21:44 +01:00
extents_status.c ext4: fix infinite loop when replaying fast_commit 2024-11-23 23:20:09 +01:00
extents_status.h ext4: make ext4_es_insert_extent() return void 2024-11-18 23:19:51 +01:00
fast_commit.c
fast_commit.h
file.c ext4: properly sync file size update after O_SYNC direct IO 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 ext4: fix corruption during on-line resize 2024-11-19 09:22:34 +01:00
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