mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 14:24:11 +08:00
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
14216561e1
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>
This commit is contained in:
parent
48379270fe
commit
e925cc431a
@ -459,14 +459,6 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
|
||||
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_cmnd *scmd)
|
||||
/* 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.
|
||||
|
Loading…
Reference in New Issue
Block a user