summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorJaegeuk Kim2015-02-26 04:25:01 +0100
committerJaegeuk Kim2015-04-11 00:08:26 +0200
commit2bca1e2388a8a9e8a3db0daf54fcc124516a3e83 (patch)
treee16f44f83f83a18ab3785f336812fb64d71a1023 /fs/f2fs/node.c
parentf2fs: fix the number of orphan inode blocks (diff)
downloadkernel-qcow2-linux-2bca1e2388a8a9e8a3db0daf54fcc124516a3e83.tar.gz
kernel-qcow2-linux-2bca1e2388a8a9e8a3db0daf54fcc124516a3e83.tar.xz
kernel-qcow2-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;