Re: [PATCH 1/4] io-wq: tweak return value of io_wqe_create_worker()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/11/21 1:40 PM, Hao Xu wrote:
> The return value of io_wqe_create_worker() should be false if we cannot
> create a new worker according to the name of this function.
> 
> Signed-off-by: Hao Xu <haoxu@xxxxxxxxxxxxxxxxx>
> ---
>  fs/io-wq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/io-wq.c b/fs/io-wq.c
> index 382efca4812b..1b102494e970 100644
> --- a/fs/io-wq.c
> +++ b/fs/io-wq.c
> @@ -267,7 +267,7 @@ static bool io_wqe_create_worker(struct io_wqe *wqe, struct io_wqe_acct *acct)
>  		return create_io_worker(wqe->wq, wqe, acct->index);
>  	}
>  
> -	return true;
> +	return false;
>  }

I think this is just a bit confusing. It's not an error case, we just
didn't need to create a worker. So don't return failure, or the caller
will think that we failed while we did not.

-- 
Jens Axboe




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux