diff options
author | Moger, Babu <Babu.Moger@netapp.com> | 2012-01-24 20:38:46 +0000 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 08:08:59 -0600 |
commit | 2082ebc45af9c9c648383b8cde0dc1948eadbf31 (patch) | |
tree | 1c010bb75da085c84cf5223035b2624dc6fbd7d6 /drivers/scsi/scsi_error.c | |
parent | 3384db9eb8b1e4f94a02c2a0ce3c0efe6142f3ba (diff) | |
download | linux-2082ebc45af9c9c648383b8cde0dc1948eadbf31.tar.bz2 |
[SCSI] fix the new host byte settings (DID_TARGET_FAILURE and DID_NEXUS_FAILURE)
This patch fixes the host byte settings DID_TARGET_FAILURE and
DID_NEXUS_FAILURE. The function __scsi_error_from_host_byte, tries to reset
the host byte to DID_OK. But that does not happen because of the OR operation.
Here is the flow.
scsi_softirq_done-> scsi_decide_disposition -> __scsi_error_from_host_byte
Let's take an example with DID_NEXUS_FAILURE. In scsi_decide_disposition,
result will be set as DID_NEXUS_FAILURE (=0x11). Then in
__scsi_error_from_host_byte, when we do OR with DID_OK. Purpose is to reset
it back to DID_OK. But that does not happen. This patch fixes this issue.
Signed-off-by: Babu Moger <babu.moger@netapp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 5f84a148eb14..6ae3b5dbd379 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1540,7 +1540,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) * Need to modify host byte to signal a * permanent target failure */ - scmd->result |= (DID_TARGET_FAILURE << 16); + set_host_byte(scmd, DID_TARGET_FAILURE); rtn = SUCCESS; } /* if rtn == FAILED, we have no sense information; @@ -1560,7 +1560,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) case RESERVATION_CONFLICT: sdev_printk(KERN_INFO, scmd->device, "reservation conflict\n"); - scmd->result |= (DID_NEXUS_FAILURE << 16); + set_host_byte(scmd, DID_NEXUS_FAILURE); return SUCCESS; /* causes immediate i/o error */ default: return FAILED; |