Skip to contentSkip to conversation

f2fs: check node page again in write end io

PATCH Superseded Yunlei He 3 participants 3 messages Jan 10, 2018 – Jan 11, 2018 F2FS file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yunlei He

author
#0 lore raw

PATCH 1/1 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.

---
 fs/f2fs/data.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/f2fs/data.c +5 -0
index 72d5d36..d9246a8 100644
@@ -114,6 +114,11 @@ static void f2fs_write_end_io(struct bio *bio)
 			if (type == F2FS_WB_CP_DATA)
 				f2fs_stop_checkpoint(sbi, true);
 		}
+
+		if (page->mapping == NODE_MAPPING(sbi) &&
+					page->index != nid_of_node(page))
+			f2fs_bug_on(sbi, 1);
+
 		dec_page_count(sbi, type);
 		clear_cold_data(page);
 		end_page_writeback(page);
Signature · 6 lines
1.9.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
maintainer
#2 lore raw
In reply to Yunlei He
Quoted 13 lines · Yunlei He

Check node page again in write end io in case of
data corruption during inflght IO.

---
 fs/f2fs/data.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/f2fs/data.c +0 -0
index 72d5d36..d9246a8 100644

fs/f2fs/data.c static void f2fs_write_end_io(struct bio *bio) · line 120

Quoted 7 lines
fs/f2fs/data.c +4 -0
@@ -114,6 +114,11 @@ static void f2fs_write_end_io(struct bio *bio)
 			if (type == F2FS_WB_CP_DATA)
 				f2fs_stop_checkpoint(sbi, true);
 		}
+
+		if (page->mapping == NODE_MAPPING(sbi) &&
+					page->index != nid_of_node(page))
+			f2fs_bug_on(sbi, 1);

Could you please write:

		f2fs_bug_on(sbi, page->mapping == NODE_MAPPING(sbi) &&
					page->index != nid_of_node(page));

Thanks,

Quoted 6 lines
fs/f2fs/data.c +1 -0
+
 		dec_page_count(sbi, type);
 		clear_cold_data(page);
 		end_page_writeback(page);
Signature · 1 line
1.9.1

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot