Skip to contentSkip to conversation

f2fs: mark gc_thread as NULL when thread creation failed

PATCH In review Namjae Jeon 1 participant 1 message Feb 2, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/6 f2fs: mark gc_thread as NULL when thread creation failed

From: Namjae Jeon <[email protected]>

When gc thread creatio failed, mark gc_thread as NULL to avoid crash while trying to stop invalid thread in stop_gc_thread->kthread_stop.
Instead make it return from:

	if (!gc_th)
       return;
---
 fs/f2fs/gc.c |    1 +
 1 file changed, 1 insertion(+)
fs/f2fs/gc.c +1 -0
index d344784..21f3ec6 100644
@@ -107,6 +107,7 @@ int start_gc_thread(struct f2fs_sb_info *sbi)
 				"f2fs_gc-%s", dev_name(sbi->sb->s_bdi->dev));
 	if (IS_ERR(gc_th->f2fs_gc_task)) {
 		kfree(gc_th);
+		sbi->gc_thread = NULL;
 		return -ENOMEM;
 	}
 	return 0;
Signature · 1 line
1.7.9.5