f2fs: return proper error from start_gc_thread
Subsystems (2)
PATCH 3/4 f2fs: return proper error from start_gc_thread
From: Namjae Jeon <[email protected]>
when there is an error from kthread_run, then return proper error rather than returning -ENOMEM.
--- fs/f2fs/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/gc.c +1 -1
@@ -105,7 +105,7 @@ int start_gc_thread(struct f2fs_sb_info *sbi)if (IS_ERR (gc_th->f2fs_gc_task)) {kfree (gc_th); sbi->gc_thread =NULL ; -return -ENOMEM ; +return PTR_ERR (gc_th->f2fs_gc_task); }return 0 ; }
Signature · 9 lines
1.7.9.5 ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
Quoted 16 lines · Namjae Jeon
From: Namjae Jeon <[email protected]>
when there is an error from
kthread_run, then return proper error rather than returning-ENOMEM.Signed-off-by Namjae Jeon <[email protected]>Signed-off-by Amit Sahrawat <[email protected]>--- fs/f2fs/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/gc.c +0
-0
fs/f2fs/gc.c int start_gc_thread(struct f2fs_sb_info *sbi) · line 106
Quoted 2 lines
fs/f2fs/gc.c +0
-0@@ -105,7 +105,7 @@ int start_gc_thread(struct f2fs_sb_info *sbi)if (IS_ERR (gc_th->f2fs_gc_task)) {kfree (gc_th);
gc_th is free'd here, save off PTR_ERR result to avoid use-after-free?
fs/f2fs/gc.c int start_gc_thread(struct f2fs_sb_info *sbi) · line 111
Quoted 7 lines
fs/f2fs/gc.c +1
-1sbi->gc_thread =NULL ; -return -ENOMEM ; +return PTR_ERR (gc_th->f2fs_gc_task); }return 0 ; }
--
Jason Hrycay
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
2013/5/23, Jason Hrycay <[email protected]>:
Quoted 12 lines · Namjae Jeon
Quoted 11 lines
From: Namjae Jeon <[email protected]>
when there is an error from
kthread_run, then return proper error rather than returning-ENOMEM.Signed-off-by Namjae Jeon <[email protected]>Signed-off-by Amit Sahrawat <[email protected]>--- fs/f2fs/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 9 lines
fs/f2fs/gc.c int start_gc_thread(struct f2fs_sb_info *sbi) · line 106
Quoted 7 lines
fs/f2fs/gc.c +0
-0@@ -105,7 +105,7 @@ int start_gc_thread(struct f2fs_sb_info *sbi)if (IS_ERR (gc_th->f2fs_gc_task)) {kfree (gc_th);
gc_this free'd here, save offPTR_ERRresult to avoid use-after-free?
Yes, I will change this patch.
Thanks for review :)
Quoted 12 lines
fs/f2fs/gc.c int start_gc_thread(struct f2fs_sb_info *sbi) · line 111
Quoted 8 lines
fs/f2fs/gc.c +1
-1sbi->gc_thread =NULL ; -return -ENOMEM ; +return PTR_ERR (gc_th->f2fs_gc_task); }return 0 ; }--
Jason Hrycay
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may