diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-07-03 10:55:52 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-08-08 14:35:56 +0900 |
commit | 8fa1e1a866b3ce1f8b030341f0cc22d7b99a7646 (patch) | |
tree | c6ebc7d915029b9e1da16e1c8376b4896910a350 /fs | |
parent | f95bd013b4f9ec8aa741deff2f23540d15f7ab40 (diff) | |
download | linux-3.10-8fa1e1a866b3ce1f8b030341f0cc22d7b99a7646.tar.gz linux-3.10-8fa1e1a866b3ce1f8b030341f0cc22d7b99a7646.tar.bz2 linux-3.10-8fa1e1a866b3ce1f8b030341f0cc22d7b99a7646.zip |
f2fs: recover date requested by fdatasync
In order to support SQLite that uses fdatasync instead of fsync, we should
guarantee the data requested by fdatasync can be recovered after sudden-power-
off.
So, let's remove the fdatasync condition in f2fs_sync_file.
Otherwise, we can restore the data after sudden-power-off due to nonexistence
of any fsync mark'ed node blocks.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/file.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index d2d2b7dbdcc..157a6357f14 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -147,9 +147,10 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) mutex_lock(&inode->i_mutex); - if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) - goto out; - + /* + * Both of fdatasync() and fsync() are able to be recovered from + * sudden-power-off. + */ if (!S_ISREG(inode->i_mode) || inode->i_nlink != 1) need_cp = true; else if (file_wrong_pino(inode)) |