From: Hannes Reinecke <hare@suse.de>
To: wenxiong@linux.vnet.ibm.com, James.Bottomley@HansenPartnership.com
Cc: hch@infradead.org, linux-scsi@vger.kernel.org, brking@linux.vnet.ibm.com
Subject: Re: [ V2 PATCH 1/2] scsi: call device handler for failed TUR command
Date: Tue, 04 Nov 2014 08:33:42 +0100 [thread overview]
Message-ID: <54588156.3070703@suse.de> (raw)
In-Reply-To: <20141103212948.123730327@linux.vnet.ibm.com>
On 11/03/2014 10:28 PM, wenxiong@linux.vnet.ibm.com wrote:
> Multipath devices using the TUR path checker need to see the sense
> code for a failed TUR command in their device handler. Since commit
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/
> drivers/scsi/scsi_error.c?id=14216561e164671ce147458653b1fea06a
> we always return success for mid layer issued TUR commands before
> calling the device handler, which stopped the TUR path checker from working.
>
> Move the call to the device handler check sense method before the early
> return for TUR commands to give the device handler a chance to intercept
> them.
>
> Signed-off-by: Christoph Hellwig <hch@infradead.org>
> Tested-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
> ---
> drivers/scsi/scsi_error.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> Index: b/drivers/scsi/scsi_error.c
> ===================================================================
> --- a/drivers/scsi/scsi_error.c 2014-10-23 12:54:16.000000000 -0500
> +++ b/drivers/scsi/scsi_error.c 2014-10-23 12:57:44.642078988 -0500
> @@ -459,14 +459,6 @@ static int scsi_check_sense(struct scsi_
> if (! scsi_command_normalize_sense(scmd, &sshdr))
> return FAILED; /* no valid sense data */
>
> - if (scmd->cmnd[0] == TEST_UNIT_READY && scmd->scsi_done != scsi_eh_done)
> - /*
> - * nasty: for mid-layer issued TURs, we need to return the
> - * actual sense data without any recovery attempt. For eh
> - * issued ones, we need to try to recover and interpret
> - */
> - return SUCCESS;
> -
> scsi_report_sense(sdev, &sshdr);
>
> if (scsi_sense_is_deferred(&sshdr))
> @@ -482,6 +474,14 @@ static int scsi_check_sense(struct scsi_
> /* handler does not care. Drop down to default handling */
> }
>
> + if (scmd->cmnd[0] == TEST_UNIT_READY && scmd->scsi_done != scsi_eh_done)
> + /*
> + * nasty: for mid-layer issued TURs, we need to return the
> + * actual sense data without any recovery attempt. For eh
> + * issued ones, we need to try to recover and interpret
> + */
> + return SUCCESS;
> +
> /*
> * Previous logic looked for FILEMARK, EOM or ILI which are
> * mainly associated with tapes and returned SUCCESS.
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-11-04 7:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 21:28 [ V2 PATCH 0/2] TUR path is down after adapter gets reset in multipath configuration wenxiong
2014-11-03 21:28 ` [ V2 PATCH 1/2] scsi: call device handler for failed TUR command wenxiong
2014-11-04 7:33 ` Hannes Reinecke [this message]
2014-11-03 21:28 ` [ V2 PATCH 2/2] scsi: TUR path is down after adapter gets reset with multipath wenxiong
-- strict thread matches above, loose matches on Subject: below --
2014-11-03 21:18 [V2 PATCH 0/2] TUR path is down after adapter gets reset in multipath configuration wenxiong
2014-11-03 21:18 ` [V2 PATCH 1/2] scsi: call device handler for failed TUR command wenxiong
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=54588156.3070703@suse.de \
--to=hare@suse.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=brking@linux.vnet.ibm.com \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=wenxiong@linux.vnet.ibm.com \
/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.