OSDN Git Service

f2fs: check node page again in write end io
authorYunlei He <heyunlei@huawei.com>
Thu, 11 Jan 2018 06:19:32 +0000 (14:19 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 8 Feb 2018 02:05:53 +0000 (18:05 -0800)
Check node page again in write end io in case of
data corruption during inflght IO.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 8148dff..bbb6eb7 100644 (file)
@@ -113,6 +113,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);