summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-02-25 19:25:01 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-04-10 15:08:26 -0700
commit2bca1e2388a8a9e8a3db0daf54fcc124516a3e83 (patch)
treee16f44f83f83a18ab3785f336812fb64d71a1023 /fs/f2fs/node.c
parent3c64298579a1343cbdf3d2f17adf774a58546aae (diff)
downloadlinux-2bca1e2388a8a9e8a3db0daf54fcc124516a3e83.tar.gz
linux-2bca1e2388a8a9e8a3db0daf54fcc124516a3e83.tar.bz2
linux-2bca1e2388a8a9e8a3db0daf54fcc124516a3e83.zip
f2fs: clear page's up-to-date if block was deallocated
If page's on-disk block was deallocated, let's remove up-to-date flag to avoid further access with wrong contents. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 28423697e97a..35a911722d59 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1002,6 +1002,7 @@ static int read_node_page(struct page *page, int rw)
get_node_info(sbi, page->index, &ni);
if (unlikely(ni.blk_addr == NULL_ADDR)) {
+ ClearPageUptodate(page);
f2fs_put_page(page, 1);
return -ENOENT;
}
@@ -1313,6 +1314,7 @@ static int f2fs_write_node_page(struct page *page,
/* This page is already truncated */
if (unlikely(ni.blk_addr == NULL_ADDR)) {
+ ClearPageUptodate(page);
dec_page_count(sbi, F2FS_DIRTY_NODES);
unlock_page(page);
return 0;