From 9cf9c37ebe90d8592ac458033d03f035f77ddd05 Mon Sep 17 00:00:00 2001 From: Yunlei He Date: Thu, 11 Jan 2018 14:19:32 +0800 Subject: [PATCH] f2fs: check node page again in write end io Check node page again in write end io in case of data corruption during inflght IO. Signed-off-by: Yunlei He Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 8b6c71bd0893..15bca4eb0859 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -114,6 +114,10 @@ static void f2fs_write_end_io(struct bio *bio) if (type == F2FS_WB_CP_DATA) f2fs_stop_checkpoint(sbi, true); } + + f2fs_bug_on(sbi, page->mapping == NODE_MAPPING(sbi) && + page->index != nid_of_node(page)); + dec_page_count(sbi, type); clear_cold_data(page); end_page_writeback(page); -- 2.20.1