From b6fe5873cb422417ae3fc914954bc5a10fd4e003 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Wed, 4 Jun 2014 00:39:42 +0900 Subject: 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 --- fs/f2fs/data.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs/f2fs/data.c') 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); } -- cgit v1.2.3-70-g09d2