diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2013-02-02 09:52:42 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-02-11 17:15:02 -0500 |
commit | 25718423ea6f7118f9c173adff0fac52414571b8 (patch) | |
tree | 8e1604e6c45a8c0e46172fd51122acd059573e7a | |
parent | ec7b1f2dd180afb1ce23aa44a7451e59bf2f3eb3 (diff) |
f2fs: mark gc_thread as NULL when thread creation is failed
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>
-rw-r--r-- | fs/f2fs/gc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index b1e498503e59..16fdec355201 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c | |||
@@ -104,6 +104,7 @@ int start_gc_thread(struct f2fs_sb_info *sbi) | |||
104 | "f2fs_gc-%u:%u", MAJOR(dev), MINOR(dev)); | 104 | "f2fs_gc-%u:%u", MAJOR(dev), MINOR(dev)); |
105 | if (IS_ERR(gc_th->f2fs_gc_task)) { | 105 | if (IS_ERR(gc_th->f2fs_gc_task)) { |
106 | kfree(gc_th); | 106 | kfree(gc_th); |
107 | sbi->gc_thread = NULL; | ||
107 | return -ENOMEM; | 108 | return -ENOMEM; |
108 | } | 109 | } |
109 | return 0; | 110 | return 0; |