* [ V3 PATCH 0/2] TUR path is down after adapter gets reset in multipath configuration @ 2014-11-06 21:11 wenxiong 2014-11-06 21:11 ` [ V3 PATCH 1/2] scsi: call device handler for failed TUR command wenxiong 2014-11-06 21:11 ` [ V3 PATCH 2/2] scsi: TUR path is down after adapter gets reset with multipath wenxiong 0 siblings, 2 replies; 5+ messages in thread From: wenxiong @ 2014-11-06 21:11 UTC (permalink / raw) To: James.Bottomley; +Cc: hch, linux-scsi, brking The first patch is unchanged and fold the logic back to scsi_dh_alua.c for the second patch. Thanks for your help! Wendy -- ^ permalink raw reply [flat|nested] 5+ messages in thread
* [ V3 PATCH 1/2] scsi: call device handler for failed TUR command 2014-11-06 21:11 [ V3 PATCH 0/2] TUR path is down after adapter gets reset in multipath configuration wenxiong @ 2014-11-06 21:11 ` wenxiong 2014-11-07 8:52 ` Hannes Reinecke 2014-11-06 21:11 ` [ V3 PATCH 2/2] scsi: TUR path is down after adapter gets reset with multipath wenxiong 1 sibling, 1 reply; 5+ messages in thread From: wenxiong @ 2014-11-06 21:11 UTC (permalink / raw) To: James.Bottomley; +Cc: hch, linux-scsi, brking [-- Attachment #1: allow_restart1 --] [-- Type: text/plain, Size: 2092 bytes --] 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. -- ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ V3 PATCH 1/2] scsi: call device handler for failed TUR command 2014-11-06 21:11 ` [ V3 PATCH 1/2] scsi: call device handler for failed TUR command wenxiong @ 2014-11-07 8:52 ` Hannes Reinecke 0 siblings, 0 replies; 5+ messages in thread From: Hannes Reinecke @ 2014-11-07 8:52 UTC (permalink / raw) To: wenxiong, James.Bottomley; +Cc: hch, linux-scsi, brking On 11/06/2014 10:11 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 GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [ V3 PATCH 2/2] scsi: TUR path is down after adapter gets reset with multipath 2014-11-06 21:11 [ V3 PATCH 0/2] TUR path is down after adapter gets reset in multipath configuration wenxiong 2014-11-06 21:11 ` [ V3 PATCH 1/2] scsi: call device handler for failed TUR command wenxiong @ 2014-11-06 21:11 ` wenxiong 2014-11-07 8:53 ` Hannes Reinecke 1 sibling, 1 reply; 5+ messages in thread From: wenxiong @ 2014-11-06 21:11 UTC (permalink / raw) To: James.Bottomley; +Cc: hch, linux-scsi, brking [-- Attachment #1: allow_restart2 --] [-- Type: text/plain, Size: 1327 bytes --] This patch fixes an issue with multipath ipr SAS devices which require a start unit command to be issued following an adapter reset. Without this patch, paths get marked failed following an adapter reset and since the error handler never gets invoked to issue the start unit, the paths are never recovered. Returning FAILED for this case ensures the error handler wakes up to issue the start unit. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Teste-by: Wen Xiong <wenxiong@linux.vnet.ibm.com> --- drivers/scsi/device_handler/scsi_dh_alua.c | 7 +++++++ 1 file changed, 7 insertions(+) Index: b/drivers/scsi/device_handler/scsi_dh_alua.c =================================================================== --- a/drivers/scsi/device_handler/scsi_dh_alua.c 2014-11-06 14:01:37.682079047 -0600 +++ b/drivers/scsi/device_handler/scsi_dh_alua.c 2014-11-06 14:04:08.772079175 -0600 @@ -474,6 +474,13 @@ static int alua_check_sense(struct scsi_ * LUN Not Ready -- Offline */ return SUCCESS; + if (sdev->allow_restart && + sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x02) + /* + * if the device is not started, we need to wake + * the error handler to start the motor + */ + return FAILED; break; case UNIT_ATTENTION: if (sense_hdr->asc == 0x29 && sense_hdr->ascq == 0x00) -- ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ V3 PATCH 2/2] scsi: TUR path is down after adapter gets reset with multipath 2014-11-06 21:11 ` [ V3 PATCH 2/2] scsi: TUR path is down after adapter gets reset with multipath wenxiong @ 2014-11-07 8:53 ` Hannes Reinecke 0 siblings, 0 replies; 5+ messages in thread From: Hannes Reinecke @ 2014-11-07 8:53 UTC (permalink / raw) To: wenxiong, James.Bottomley; +Cc: hch, linux-scsi, brking On 11/06/2014 10:11 PM, wenxiong@linux.vnet.ibm.com wrote: > This patch fixes an issue with multipath ipr SAS devices which require a > start unit command to be issued following an adapter reset. Without this > patch, paths get marked failed following an adapter reset and since the > error handler never gets invoked to issue the start unit, the paths are > never recovered. Returning FAILED for this case ensures the error > handler wakes up to issue the start unit. > > Signed-off-by: Brian King <brking@linux.vnet.ibm.com> > Teste-by: Wen Xiong <wenxiong@linux.vnet.ibm.com> > --- > drivers/scsi/device_handler/scsi_dh_alua.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > Index: b/drivers/scsi/device_handler/scsi_dh_alua.c > =================================================================== > --- a/drivers/scsi/device_handler/scsi_dh_alua.c 2014-11-06 14:01:37.682079047 -0600 > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c 2014-11-06 14:04:08.772079175 -0600 > @@ -474,6 +474,13 @@ static int alua_check_sense(struct scsi_ > * LUN Not Ready -- Offline > */ > return SUCCESS; > + if (sdev->allow_restart && > + sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x02) > + /* > + * if the device is not started, we need to wake > + * the error handler to start the motor > + */ > + return FAILED; > break; > case UNIT_ATTENTION: > if (sense_hdr->asc == 0x29 && sense_hdr->ascq == 0x00) > Reviewed-by: Hannes Reinecke <hare@suse.de> Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (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 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-07 8:53 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-11-06 21:11 [ V3 PATCH 0/2] TUR path is down after adapter gets reset in multipath configuration wenxiong 2014-11-06 21:11 ` [ V3 PATCH 1/2] scsi: call device handler for failed TUR command wenxiong 2014-11-07 8:52 ` Hannes Reinecke 2014-11-06 21:11 ` [ V3 PATCH 2/2] scsi: TUR path is down after adapter gets reset with multipath wenxiong 2014-11-07 8:53 ` Hannes Reinecke
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).