mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-21 06:24:12 +00:00
[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>
This commit is contained in:
parent
3384db9eb8
commit
2082ebc45a
2 changed files with 4 additions and 4 deletions
|
@ -1540,7 +1540,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
|
||||||
* Need to modify host byte to signal a
|
* Need to modify host byte to signal a
|
||||||
* permanent target failure
|
* permanent target failure
|
||||||
*/
|
*/
|
||||||
scmd->result |= (DID_TARGET_FAILURE << 16);
|
set_host_byte(scmd, DID_TARGET_FAILURE);
|
||||||
rtn = SUCCESS;
|
rtn = SUCCESS;
|
||||||
}
|
}
|
||||||
/* if rtn == FAILED, we have no sense information;
|
/* if rtn == FAILED, we have no sense information;
|
||||||
|
@ -1560,7 +1560,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
|
||||||
case RESERVATION_CONFLICT:
|
case RESERVATION_CONFLICT:
|
||||||
sdev_printk(KERN_INFO, scmd->device,
|
sdev_printk(KERN_INFO, scmd->device,
|
||||||
"reservation conflict\n");
|
"reservation conflict\n");
|
||||||
scmd->result |= (DID_NEXUS_FAILURE << 16);
|
set_host_byte(scmd, DID_NEXUS_FAILURE);
|
||||||
return SUCCESS; /* causes immediate i/o error */
|
return SUCCESS; /* causes immediate i/o error */
|
||||||
default:
|
default:
|
||||||
return FAILED;
|
return FAILED;
|
||||||
|
|
|
@ -682,11 +682,11 @@ static int __scsi_error_from_host_byte(struct scsi_cmnd *cmd, int result)
|
||||||
error = -ENOLINK;
|
error = -ENOLINK;
|
||||||
break;
|
break;
|
||||||
case DID_TARGET_FAILURE:
|
case DID_TARGET_FAILURE:
|
||||||
cmd->result |= (DID_OK << 16);
|
set_host_byte(cmd, DID_OK);
|
||||||
error = -EREMOTEIO;
|
error = -EREMOTEIO;
|
||||||
break;
|
break;
|
||||||
case DID_NEXUS_FAILURE:
|
case DID_NEXUS_FAILURE:
|
||||||
cmd->result |= (DID_OK << 16);
|
set_host_byte(cmd, DID_OK);
|
||||||
error = -EBADE;
|
error = -EBADE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Reference in a new issue