> -     blk_status_t ret;
> +     int ret;
>       int (*handler)(struct Scsi_Host *, struct sas_rphy *, struct request *);

This part looks ok.

>       while ((req = blk_fetch_request(q)) != NULL) {
> @@ -185,7 +185,9 @@ static void sas_smp_request(struct request_queue *q, 
> struct Scsi_Host *shost,
>                               blk_rq_bytes(req->next_rq);
>               handler = to_sas_internal(shost->transportt)->f->smp_handler;
>               ret = handler(shost, rphy, req);
> -             scsi_req(req)->result = ret;
> +             WARN_ONCE(ret != 0 && !IS_ERR_VALUE((uintptr_t)ret),
> +                       "%s: ret = %d\n", __func__, ret);
> +             scsi_req(req)->result = ret ? DID_ERROR << 16 : 0;

This one doesn't.  All the way back until this code was fixed up
after the initial introduction it returned negative error codes
to user space.

Take a look at committs 7aa68e80bd481faae1234bc2a7e4bcc9348f98b4 and
2d507a01dac338831266b44ccbb01c69e84606ed for details.

Reply via email to