TUR path is down after adapter gets reset in multipath configuration
v3 cover TUR path is down after adapter gets reset in multipath configuration
The first patch is unchanged and fold the logic back to scsi_dh_alua.c for the second patch.
Thanks for your help!
Wendy
PATCH v3 1/2 scsi: call device handler for failed TUR command
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.
--- drivers/scsi/scsi_error.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/scsi/scsi_error.c +8 -8
@@ -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.
Re: [ V3 PATCH 1/2] scsi: call device handler for failed TUR command
Quoted 42 lines · On 11/06/2014 10:11 PM, [email protected] 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 <[email protected]>Tested-by Wen Xiong <[email protected]>--- drivers/scsi/scsi_error.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)Index:
b/drivers/scsi/scsi_error.c
===================================================================drivers/scsi/scsi_error.c +1
-8@@ -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)
drivers/scsi/scsi_error.c static int scsi_check_sense(struct scsi_ · line 487
Quoted 10 lines
drivers/scsi/scsi_error.c +7
-0+/* +* 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.
Cheers,
Hannes
Signature · 8 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 2/2 scsi: TUR path is down after adapter gets reset with multipath
In reply to [email protected]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.
--- drivers/scsi/device_handler/scsi_dh_alua.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/scsi/device_handler/scsi_dh_alua.c +7 -0
@@ -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 )
Re: [ V3 PATCH 2/2] scsi: TUR path is down after adapter gets reset with multipath
Quoted 22 lines · On 11/06/2014 10:11 PM, [email protected] 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 <[email protected]>Teste-by Wen Xiong <[email protected]>--- drivers/scsi/device_handler/scsi_dh_alua.c | 7 +++++++ 1 file changed, 7 insertions(+)Index:
b/drivers/scsi/device_handler/scsi_dh_alua.c
===================================================================drivers/scsi/device_handler/scsi_dh_alua.c +0
-0@@ -474,6 +474,13 @@ static int alua_check_sense(struct scsi_* LUN Not Ready -- Offline */ return SUCCESS ;
drivers/scsi/device_handler/scsi_dh_alua.c static int alua_check_sense(struct scsi_ · line 486
Quoted 10 lines
drivers/scsi/device_handler/scsi_dh_alua.c +7
-0+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 )
Cheers,
Hannes
Signature · 8 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html