Skip to content

Commit

Permalink
f2fs: mark gc_thread as NULL when thread creation is failed
Browse files Browse the repository at this point in the history
When gc thread creation is 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;

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
  • Loading branch information
Namjae Jeon authored and Jaegeuk Kim committed Feb 11, 2013
1 parent ec7b1f2 commit 2571842
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/f2fs/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ int start_gc_thread(struct f2fs_sb_info *sbi)
"f2fs_gc-%u:%u", MAJOR(dev), MINOR(dev));
if (IS_ERR(gc_th->f2fs_gc_task)) {
kfree(gc_th);
sbi->gc_thread = NULL;
return -ENOMEM;
}
return 0;
Expand Down

0 comments on commit 2571842

Please sign in to comment.