Commit 4d003353 authored by Martin Wilck's avatar Martin Wilck Committed by Greg Kroah-Hartman

scsi: core: reset host byte in DID_NEXUS_FAILURE case

commit 4a067cf8 upstream.

Up to 4.12, __scsi_error_from_host_byte() would reset the host byte to
DID_OK for various cases including DID_NEXUS_FAILURE.  Commit
2a842aca ("block: introduce new block status code type") replaced this
function with scsi_result_to_blk_status() and removed the host-byte
resetting code for the DID_NEXUS_FAILURE case.  As the line
set_host_byte(cmd, DID_OK) was preserved for the other cases, I suppose
this was an editing mistake.

The fact that the host byte remains set after 4.13 is causing problems with
the sg_persist tool, which now returns success rather then exit status 24
when a RESERVATION CONFLICT error is encountered.

Fixes: 2a842aca "block: introduce new block status code type"
Signed-off-by: default avatarMartin Wilck <mwilck@suse.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 069fb92e
...@@ -734,6 +734,7 @@ static blk_status_t __scsi_error_from_host_byte(struct scsi_cmnd *cmd, ...@@ -734,6 +734,7 @@ static blk_status_t __scsi_error_from_host_byte(struct scsi_cmnd *cmd,
set_host_byte(cmd, DID_OK); set_host_byte(cmd, DID_OK);
return BLK_STS_TARGET; return BLK_STS_TARGET;
case DID_NEXUS_FAILURE: case DID_NEXUS_FAILURE:
set_host_byte(cmd, DID_OK);
return BLK_STS_NEXUS; return BLK_STS_NEXUS;
case DID_ALLOC_FAILURE: case DID_ALLOC_FAILURE:
set_host_byte(cmd, DID_OK); set_host_byte(cmd, DID_OK);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment