f2fs: trigger fdatasync for non-atomic_write file
authorChao Yu <yuchao0@huawei.com>
Wed, 23 Aug 2017 10:23:25 +0000 (18:23 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 29 Aug 2017 17:05:42 +0000 (10:05 -0700)
Sqlite only cares about synchronization of file data instead of other data
unrelated attribute of inode, so in commit flow, call fdatasync is enough.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index d74f1a9..63e3949 100644 (file)
@@ -1683,7 +1683,7 @@ static int f2fs_ioc_commit_atomic_write(struct file *filp)
                        stat_dec_atomic_write(inode);
                }
        } else {
-               ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, false);
+               ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 1, false);
        }
 err_out:
        inode_unlock(inode);