f2fs: clear page uptodate when dropping cache for atomic write
authorChao Yu <chao2.yu@samsung.com>
Fri, 13 Nov 2015 10:27:35 +0000 (18:27 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 4 Dec 2015 19:52:35 +0000 (11:52 -0800)
We should clear uptodate flag for all pages atomic written when we drop
them, otherwise before these cached pages were reclaimed or invalidated
eventually, we will see invalid data when hitting them again.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index efbf6b5f1dc3a075750e2e0c2fad27018bc246c0..ed2c5dec75267f2780f709a19d51d739c50844d8 100644 (file)
@@ -247,6 +247,7 @@ int commit_inmem_pages(struct inode *inode, bool abort)
                                submit_bio = true;
                        }
                } else {
+                       ClearPageUptodate(cur->page);
                        trace_f2fs_commit_inmem_page(cur->page, INMEM_DROP);
                }
                set_page_private(cur->page, 0);