summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/data.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/data.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/data.c')
-rw-r--r--fs/f2fs/data.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index ae5c41444e8f..62e31b2aa131 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1259,8 +1259,10 @@ int do_write_data_page(struct page *page, struct f2fs_io_info *fio)
fio->blk_addr = dn.data_blkaddr;
/* This page is already truncated */
- if (fio->blk_addr == NULL_ADDR)
+ if (fio->blk_addr == NULL_ADDR) {
+ ClearPageUptodate(page);
goto out_writepage;
+ }
set_page_writeback(page);
@@ -1355,6 +1357,8 @@ done:
clear_cold_data(page);
out:
inode_dec_dirty_pages(inode);
+ if (err)
+ ClearPageUptodate(page);
unlock_page(page);
if (need_balance_fs)
f2fs_balance_fs(sbi);