[2/2] f2fs: fix return val in f2fs_start_ckpt_thread()

Message ID 20221027102447.75708-2-frank.li@vivo.com
State New
Headers
Series [1/2] f2fs: cleanup in f2fs_create_flush_cmd_control() and f2fs_start_gc_thread() |

Commit Message

李扬韬 Oct. 27, 2022, 10:24 a.m. UTC
  Return PTR_ERR(cprc->f2fs_issue_ckpt) instead of -ENOMEM;

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/f2fs/checkpoint.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Chao Yu Oct. 27, 2022, 1:21 p.m. UTC | #1
On 2022/10/27 18:24, Yangtao Li wrote:
> Return PTR_ERR(cprc->f2fs_issue_ckpt) instead of -ENOMEM;
> 

Fixes line?

> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
  
Jaegeuk Kim Oct. 27, 2022, 5:29 p.m. UTC | #2
I integrated two patches into single one. I think we don't need Fixes.

On 10/27, Chao Yu wrote:
> On 2022/10/27 18:24, Yangtao Li wrote:
> > Return PTR_ERR(cprc->f2fs_issue_ckpt) instead of -ENOMEM;
> > 
> 
> Fixes line?
> 
> > Signed-off-by: Yangtao Li <frank.li@vivo.com>
> 
> Reviewed-by: Chao Yu <chao@kernel.org>
> 
> Thanks,
  

Patch

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 2a5d9256a6f4..12fd12f2bb97 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -1899,8 +1899,9 @@  int f2fs_start_ckpt_thread(struct f2fs_sb_info *sbi)
 	cprc->f2fs_issue_ckpt = kthread_run(issue_checkpoint_thread, sbi,
 			"f2fs_ckpt-%u:%u", MAJOR(dev), MINOR(dev));
 	if (IS_ERR(cprc->f2fs_issue_ckpt)) {
+		int err = PTR_ERR(cprc->f2fs_issue_ckpt);
 		cprc->f2fs_issue_ckpt = NULL;
-		return -ENOMEM;
+		return err;
 	}
 
 	set_task_ioprio(cprc->f2fs_issue_ckpt, cprc->ckpt_thread_ioprio);