Skip to contentSkip to conversation

f2fs: add a bug_on in is_alive

PATCH New Yunlei He 1 participant 2 messages Mar 22, 2017 F2FS file system

lore
Share & tools
lore

Yunlei He

author
#0 lore raw

PATCH 1/2 f2fs: add a bug_on in is_alive

This patch add a bug_on in is_alive in case of infinite loop.

---
 fs/f2fs/gc.c | 1 +
 1 file changed, 1 insertion(+)
fs/f2fs/gc.c +1 -0
index 418fd98..c01168c 100644
@@ -550,6 +550,7 @@ static bool is_alive(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
 	get_node_info(sbi, nid, dni);
 
 	if (sum->version != dni->version) {
+		f2fs_bug_on(sbi, (sum->version + 1) != dni->version);
 		f2fs_put_page(node_page, 1);
 		return false;
 	}
Signature · 6 lines
2.10.1


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

PATCH 2/2 f2fs: use set_page_private marcro in f2fs_trace_pid

Use set_page_private marcro instead of operte page struct directly

---
 fs/f2fs/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/trace.c +1 -1
index c82ab40..bccbbf2 100644
@@ -59,7 +59,7 @@ void f2fs_trace_pid(struct page *page)
 	pid_t pid = task_pid_nr(current);
 	void *p;
 
-	page->private = pid;
+	set_page_private(page, (unsigned long)pid);
 
 	if (radix_tree_preload(GFP_NOFS))
 		return;
Signature · 6 lines
2.10.1


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