aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2014-11-06 16:11:22 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-10 09:23:19 -0500
commite925cc431ac8285ad6e8b3fe09f6e3d8b3c30d56 (patch)
tree70ff4f072465a6d8ed71a42a92b593fe4defaeb9 /drivers/scsi/scsi_error.c
parent48379270fe6808cf4612ee094adc8da2b7a83baa (diff)
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 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> Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index c21e53071600..bc5ff6ff9c79 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -459,14 +459,6 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
459 if (! scsi_command_normalize_sense(scmd, &sshdr)) 459 if (! scsi_command_normalize_sense(scmd, &sshdr))
460 return FAILED; /* no valid sense data */ 460 return FAILED; /* no valid sense data */
461 461
462 if (scmd->cmnd[0] == TEST_UNIT_READY && scmd->scsi_done != scsi_eh_done)
463 /*
464 * nasty: for mid-layer issued TURs, we need to return the
465 * actual sense data without any recovery attempt. For eh
466 * issued ones, we need to try to recover and interpret
467 */
468 return SUCCESS;
469
470 scsi_report_sense(sdev, &sshdr); 462 scsi_report_sense(sdev, &sshdr);
471 463
472 if (scsi_sense_is_deferred(&sshdr)) 464 if (scsi_sense_is_deferred(&sshdr))
@@ -482,6 +474,14 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
482 /* handler does not care. Drop down to default handling */ 474 /* handler does not care. Drop down to default handling */
483 } 475 }
484 476
477 if (scmd->cmnd[0] == TEST_UNIT_READY && scmd->scsi_done != scsi_eh_done)
478 /*
479 * nasty: for mid-layer issued TURs, we need to return the
480 * actual sense data without any recovery attempt. For eh
481 * issued ones, we need to try to recover and interpret
482 */
483 return SUCCESS;
484
485 /* 485 /*
486 * Previous logic looked for FILEMARK, EOM or ILI which are 486 * Previous logic looked for FILEMARK, EOM or ILI which are
487 * mainly associated with tapes and returned SUCCESS. 487 * mainly associated with tapes and returned SUCCESS.