From 2082ebc45af9c9c648383b8cde0dc1948eadbf31 Mon Sep 17 00:00:00 2001 From: "Moger, Babu" Date: Tue, 24 Jan 2012 20:38:46 +0000 Subject: [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 Signed-off-by: James Bottomley --- drivers/scsi/scsi_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/scsi_lib.c') diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index b2c95dbe9d6..5b770e9e82c 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -682,11 +682,11 @@ static int __scsi_error_from_host_byte(struct scsi_cmnd *cmd, int result) error = -ENOLINK; break; case DID_TARGET_FAILURE: - cmd->result |= (DID_OK << 16); + set_host_byte(cmd, DID_OK); error = -EREMOTEIO; break; case DID_NEXUS_FAILURE: - cmd->result |= (DID_OK << 16); + set_host_byte(cmd, DID_OK); error = -EBADE; break; default: -- cgit v1.2.3