Re: [PATCH] scsi_transport_sas: Fix error handling in sas_smp_request()

2017-08-25 Thread h...@lst.de
On Fri, Aug 25, 2017 at 03:38:48PM +, Bart Van Assche wrote: > On Fri, 2017-08-25 at 17:35 +0200, Christoph Hellwig wrote: > > I looked a bit more at the history of this, and it seems like the only > > issue with commit 17d5363b83f8 here is using the blk_status_t type for the > > ret variable.

Re: [PATCH] scsi_transport_sas: Fix error handling in sas_smp_request()

2017-08-25 Thread Bart Van Assche
On Fri, 2017-08-25 at 17:35 +0200, Christoph Hellwig wrote: > I looked a bit more at the history of this, and it seems like the only > issue with commit 17d5363b83f8 here is using the blk_status_t type for the > ret variable. Even before that the negative error code leaked out > to userspace. We

Re: [PATCH] scsi_transport_sas: Fix error handling in sas_smp_request()

2017-08-25 Thread Christoph Hellwig
Hi Bart, I looked a bit more at the history of this, and it seems like the only issue with commit 17d5363b83f8 here is using the blk_status_t type for the ret variable. Even before that the negative error code leaked out to userspace. We can try to just turn that back into an int, but I'll also

Re: [PATCH] scsi_transport_sas: Fix error handling in sas_smp_request()

2017-08-25 Thread Hannes Reinecke
On 08/24/2017 06:06 PM, Bart Van Assche wrote: > On Thu, 2017-08-24 at 14:21 +0200, Hannes Reinecke wrote: >> On 08/23/2017 08:25 PM, Bart Van Assche wrote: >>> sas_function_template.smp_handler implementations either return >>> 0 or a Unix error code. Convert that error code into a SCSI >>>

Re: [PATCH] scsi_transport_sas: Fix error handling in sas_smp_request()

2017-08-24 Thread Bart Van Assche
On Thu, 2017-08-24 at 14:21 +0200, Hannes Reinecke wrote: > On 08/23/2017 08:25 PM, Bart Van Assche wrote: > > sas_function_template.smp_handler implementations either return > > 0 or a Unix error code. Convert that error code into a SCSI > > result. This patch is what I came up with after having

Re: [PATCH] scsi_transport_sas: Fix error handling in sas_smp_request()

2017-08-24 Thread Hannes Reinecke
On 08/23/2017 08:25 PM, Bart Van Assche wrote: > sas_function_template.smp_handler implementations either return > 0 or a Unix error code. Convert that error code into a SCSI > result. This patch is what I came up with after having analyzed > the following sparse warnings: > >

Re: [PATCH] scsi_transport_sas: Fix error handling in sas_smp_request()

2017-08-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

[PATCH] scsi_transport_sas: Fix error handling in sas_smp_request()

2017-08-23 Thread Bart Van Assche
sas_function_template.smp_handler implementations either return 0 or a Unix error code. Convert that error code into a SCSI result. This patch is what I came up with after having analyzed the following sparse warnings: drivers/scsi/scsi_transport_sas.c:187:21: warning: incorrect type in