diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-06-04 00:39:42 +0900 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-06-04 18:41:38 +0900 |
commit | b6fe5873cb422417ae3fc914954bc5a10fd4e003 (patch) | |
tree | d9e958f62b4ed402a1b10e2592453320c6ff1447 /fs/f2fs/data.c | |
parent | 1dbe4152168d44fa164edbdc9f1243de70b98f7a (diff) |
f2fs: fix to recover data written by dio
If data are overwritten through dio, previous f2fs doesn't remain the fsync mark
due to no additional node writes.
Note that this patch should resolve the xfstests:311.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 8c250a5d6f2..39fe7d70791 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1041,6 +1041,9 @@ static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb, if (check_direct_IO(inode, rw, iov, offset, nr_segs)) return 0; + /* clear fsync mark to recover these blocks */ + fsync_mark_clear(F2FS_SB(inode->i_sb), inode->i_ino); + return blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, get_data_block); } |