diff options
author | Sunmin Jeong <[email protected]> | 2024-03-13 20:26:19 +0900 |
---|---|---|
committer | Jaegeuk Kim <[email protected]> | 2024-03-14 09:08:39 -0700 |
commit | 4bf78322346f6320313683dc9464e5423423ad5c (patch) | |
tree | f3c1c90b773ef09e6be4383e944adedf1c2ad1c3 /tools/testing/selftests/bpf/progs/test_autoload.c | |
parent | c644af1332833a5baa2b6a9220d1a1d988352b26 (diff) |
f2fs: mark inode dirty for FI_ATOMIC_COMMITTED flag
In f2fs_update_inode, i_size of the atomic file isn't updated until
FI_ATOMIC_COMMITTED flag is set. When committing atomic write right
after the writeback of the inode, i_size of the raw inode will not be
updated. It can cause the atomicity corruption due to a mismatch between
old file size and new data.
To prevent the problem, let's mark inode dirty for FI_ATOMIC_COMMITTED
Atomic write thread Writeback thread
__writeback_single_inode
write_inode
f2fs_update_inode
- skip i_size update
f2fs_ioc_commit_atomic_write
f2fs_commit_atomic_write
set_inode_flag(inode, FI_ATOMIC_COMMITTED)
f2fs_do_sync_file
f2fs_fsync_node_pages
- skip f2fs_update_inode since the inode is clean
Fixes: 3db1de0e582c ("f2fs: change the current atomic write way")
Cc: [email protected] #v5.19+
Reviewed-by: Sungjong Seo <[email protected]>
Reviewed-by: Yeongjin Gil <[email protected]>
Signed-off-by: Sunmin Jeong <[email protected]>
Reviewed-by: Daeho Jeong <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_autoload.c')
0 files changed, 0 insertions, 0 deletions