f2fs: avoid unnecessary updating inode during fsync
If roll-forward recovery can recover i_size, we don't need to update inode's
metadata during fsync.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index b5144b8..6fa4ec8 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -613,6 +613,9 @@
inode->i_ino == F2FS_META_INO(sbi))
return;
+ if (is_inode_flag_set(inode, FI_AUTO_RECOVER))
+ clear_inode_flag(inode, FI_AUTO_RECOVER);
+
spin_lock(&sbi->inode_lock[DIRTY_META]);
if (is_inode_flag_set(inode, FI_DIRTY_INODE)) {
spin_unlock(&sbi->inode_lock[DIRTY_META]);
@@ -638,6 +641,7 @@
}
list_del_init(&F2FS_I(inode)->gdirty_list);
clear_inode_flag(inode, FI_DIRTY_INODE);
+ clear_inode_flag(inode, FI_AUTO_RECOVER);
dec_page_count(sbi, F2FS_DIRTY_IMETA);
spin_unlock(&sbi->inode_lock[DIRTY_META]);
stat_dec_dirty_inode(F2FS_I_SB(inode), DIRTY_META);