diff options
author | Sunmin Jeong <s_min.jeong@samsung.com> | 2024-03-13 20:26:20 +0900 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2024-03-14 09:08:43 -0700 |
commit | 74b0ebcbdde4c7fe23c979e4cfc2fdbf349c39a3 (patch) | |
tree | 92fcfaa7f879f6a40515979c3dc9cb9298e41c61 /fs/f2fs/debug.c | |
parent | 4bf78322346f6320313683dc9464e5423423ad5c (diff) | |
download | linux-74b0ebcbdde4c7fe23c979e4cfc2fdbf349c39a3.tar.gz linux-74b0ebcbdde4c7fe23c979e4cfc2fdbf349c39a3.tar.bz2 linux-74b0ebcbdde4c7fe23c979e4cfc2fdbf349c39a3.zip |
f2fs: truncate page cache before clearing flags when aborting atomic write
In f2fs_do_write_data_page, FI_ATOMIC_FILE flag selects the target inode
between the original inode and COW inode. When aborting atomic write and
writeback occur simultaneously, invalid data can be written to original
inode if the FI_ATOMIC_FILE flag is cleared meanwhile.
To prevent the problem, let's truncate all pages before clearing the flag
Atomic write thread Writeback thread
f2fs_abort_atomic_write
clear_inode_flag(inode, FI_ATOMIC_FILE)
__writeback_single_inode
do_writepages
f2fs_do_write_data_page
- use dn of original inode
truncate_inode_pages_final
Fixes: 3db1de0e582c ("f2fs: change the current atomic write way")
Cc: stable@vger.kernel.org #v5.19+
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Reviewed-by: Yeongjin Gil <youngjin.gil@samsung.com>
Signed-off-by: Sunmin Jeong <s_min.jeong@samsung.com>
Reviewed-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/debug.c')
0 files changed, 0 insertions, 0 deletions