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>
This commit is contained in:
Jaegeuk Kim
2016-05-20 20:42:37 -07:00
parent ee6d182f2a
commit 26de9b1171
7 changed files with 43 additions and 6 deletions

View File

@@ -208,7 +208,7 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
}
/* if the inode is dirty, let's recover all the time */
if (!datasync) {
if (!datasync && !f2fs_skip_inode_update(inode)) {
f2fs_write_inode(inode, NULL);
goto go_write;
}
@@ -251,7 +251,7 @@ go_write:
goto out;
}
sync_nodes:
ret = fsync_node_pages(sbi, ino, &wbc, atomic);
ret = fsync_node_pages(sbi, inode, &wbc, atomic);
if (ret)
goto out;