diff options
author | Daeho Jeong <daehojeong@google.com> | 2024-09-04 08:33:06 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2024-09-11 03:30:27 +0000 |
commit | fccaa81de87e80b1809906f7e438e5766fbdc172 (patch) | |
tree | dd23facfc073f400fa783799d7d3746fe60030be /fs/f2fs/inode.c | |
parent | 5697e94daab9e40cbf1fb368781d110f22fb6760 (diff) |
f2fs: prevent atomic file from being dirtied before commit
Keep atomic file clean while updating and make it dirtied during commit
in order to avoid unnecessary and excessive inode updates in the previous
fix.
Fixes: 4bf78322346f ("f2fs: mark inode dirty for FI_ATOMIC_COMMITTED flag")
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inode.c')
-rw-r--r-- | fs/f2fs/inode.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index b2d5c3ef8e24..1ed86df343a5 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -34,6 +34,11 @@ void f2fs_mark_inode_dirty_sync(struct inode *inode, bool sync) if (f2fs_inode_dirtied(inode, sync)) return; + if (f2fs_is_atomic_file(inode)) { + set_inode_flag(inode, FI_ATOMIC_DIRTIED); + return; + } + mark_inode_dirty_sync(inode); } |