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/node.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'fs/f2fs/node.c') diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 02a59e9027b1..a0a1f25ed20f 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -153,6 +153,18 @@ bool fsync_mark_done(struct f2fs_sb_info *sbi, nid_t nid) return fsync_done; } +void fsync_mark_clear(struct f2fs_sb_info *sbi, nid_t nid) +{ + struct f2fs_nm_info *nm_i = NM_I(sbi); + struct nat_entry *e; + + write_lock(&nm_i->nat_tree_lock); + e = __lookup_nat_cache(nm_i, nid); + if (e) + e->fsync_done = false; + write_unlock(&nm_i->nat_tree_lock); +} + static struct nat_entry *grab_nat_entry(struct f2fs_nm_info *nm_i, nid_t nid) { struct nat_entry *new; -- cgit v1.2.3