Commit e925cc431ac8285ad6e8b3fe09f6e3d8b3c30d56
Committed by
Christoph Hellwig
1 parent
48379270fe
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
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>
Showing 1 changed file with 8 additions and 8 deletions Side-by-side Diff
drivers/scsi/scsi_error.c
... | ... | @@ -459,14 +459,6 @@ |
459 | 459 | if (! scsi_command_normalize_sense(scmd, &sshdr)) |
460 | 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 | 462 | scsi_report_sense(sdev, &sshdr); |
471 | 463 | |
472 | 464 | if (scsi_sense_is_deferred(&sshdr)) |
... | ... | @@ -481,6 +473,14 @@ |
481 | 473 | return rc; |
482 | 474 | /* handler does not care. Drop down to default handling */ |
483 | 475 | } |
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 | 484 | |
485 | 485 | /* |
486 | 486 | * Previous logic looked for FILEMARK, EOM or ILI which are |