All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Bart Van Assche <bart.vanassche@wdc.com>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	linux-scsi@vger.kernel.org,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
	Ingo Molnar <mingo@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Hannes Reinecke <hare@suse.de>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	stable@vger.kernel.org
Subject: Re: [PATCH v3 3/3] scsi_transport_sas: Fix error handling in sas_smp_request()
Date: Tue, 29 Aug 2017 15:08:57 +0200	[thread overview]
Message-ID: <20170829130857.GA29153@lst.de> (raw)
In-Reply-To: <20170828204149.28693-8-bart.vanassche@wdc.com>

> -	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	other threads:[~2017-08-29 13:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 20:41 [PATCH v3 0/3] Rework handling of scsi_device.vpd_pg8[03] Bart Van Assche
2017-08-28 20:41 ` [PATCH v3 1/3] Rework the code for caching Vital Product Data (VPD) Bart Van Assche
2017-08-29  6:25   ` Hannes Reinecke
2017-08-28 20:41 ` [PATCH v3 2/3] Rework handling of scsi_device.vpd_pg8[03] Bart Van Assche
2017-08-29  6:33   ` Hannes Reinecke
2017-08-28 20:41 ` [PATCH v3 3/3] scsi_transport_sas: Fix error handling in sas_smp_request() Bart Van Assche
2017-08-28 20:41 ` [PATCH v3 0/3] Rework handling of scsi_device.vpd_pg8[03] Bart Van Assche
2017-08-28 20:41 ` [PATCH v3 1/3] Rework the code for caching Vital Product Data (VPD) Bart Van Assche
2017-08-28 20:41 ` [PATCH v3 2/3] Rework handling of scsi_device.vpd_pg8[03] Bart Van Assche
2017-08-28 20:41 ` [PATCH v3 3/3] scsi_transport_sas: Fix error handling in sas_smp_request() Bart Van Assche
2017-08-29 13:08   ` Christoph Hellwig [this message]
2017-08-28 20:43 ` [PATCH v3 0/3] Rework handling of scsi_device.vpd_pg8[03] Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170829130857.GA29153@lst.de \
    --to=hch@lst.de \
    --cc=bart.vanassche@wdc.com \
    --cc=hare@suse.de \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.