aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-07-02 21:55:52 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-07-30 02:17:02 -0400
commite5d2385ed6d8543a8884afc28aee44d46cfe64be (patch)
treefc3e1a9a7ff1e038aacc1a1b45f75e7048932b05
parent36f571e9ed0419e73d127e18aa8992ced867268c (diff)
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>
-rw-r--r--fs/f2fs/file.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index d2d2b7dbdcc1..157a6357f14c 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)
147 147
148 mutex_lock(&inode->i_mutex); 148 mutex_lock(&inode->i_mutex);
149 149
150 if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) 150 /*
151 goto out; 151 * Both of fdatasync() and fsync() are able to be recovered from
152 152 * sudden-power-off.
153 */
153 if (!S_ISREG(inode->i_mode) || inode->i_nlink != 1) 154 if (!S_ISREG(inode->i_mode) || inode->i_nlink != 1)
154 need_cp = true; 155 need_cp = true;
155 else if (file_wrong_pino(inode)) 156 else if (file_wrong_pino(inode))