lkml.org 
[lkml]   [2019]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] nvmet-file: fix nvmet_file_flush() always returning an error
Date
On 07/15/2019 03:17 PM, Logan Gunthorpe wrote:
> Presently, nvmet_file_flush() always returns a call to
> errno_to_nvme_status() but that helper doesn't take into account the
> case when errno=0. So nvmet_file_flush() always returns an error code.
>
> All other callers of errno_to_nvme_status() check for success before
> calling it.
>
> To fix this, ensure errno_to_nvme_status() returns success if the
> errno is zero. This should prevent future mistakes like this from
> happening.
>
> Fixes: c6aa3542e010 ("nvmet: add error log support for file backend")
> Signed-off-by: Logan Gunthorpe<logang@deltatee.com>
> Cc: Chaitanya Kulkarni<chaitanya.kulkarni@wdc.com>

Thanks for the fix Logan, errno_to_nvme_status() needs to be only called
in the case of error. Clearly bad example of calling function withing
function.

Looks good to me.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

\
 
 \ /
  Last update: 2019-07-17 20:36    [W:0.103 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site