[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9049ab55-7be4-4cc8-b2f2-2cc355f0bc8e@kernel.org>
Date: Thu, 14 Mar 2024 18:34:59 +0800
From: Chao Yu <chao@...nel.org>
To: Sunmin Jeong <s_min.jeong@...sung.com>, jaegeuk@...nel.org,
daehojeong@...gle.com
Cc: linux-f2fs-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
stable@...r.kernel.org, Sungjong Seo <sj1557.seo@...sung.com>,
Yeongjin Gil <youngjin.gil@...sung.com>
Subject: Re: [PATCH 1/2] f2fs: mark inode dirty for FI_ATOMIC_COMMITTED flag
On 2024/3/13 19:26, Sunmin Jeong wrote:
> 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: stable@...r.kernel.org #v5.19+
> Reviewed-by: Sungjong Seo <sj1557.seo@...sung.com>
> Reviewed-by: Yeongjin Gil <youngjin.gil@...sung.com>
> Signed-off-by: Sunmin Jeong <s_min.jeong@...sung.com>
Reviewed-by: Chao Yu <chao@...nel.org>
Thanks,
Powered by blists - more mailing lists