|
@@ -147,9 +147,10 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
|
|
|
|
|
|
mutex_lock(&inode->i_mutex);
|
|
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)
|
|
if (!S_ISREG(inode->i_mode) || inode->i_nlink != 1)
|
|
need_cp = true;
|
|
need_cp = true;
|
|
else if (file_wrong_pino(inode))
|
|
else if (file_wrong_pino(inode))
|