Commit 7f33f56b authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

scsi: fas216: Translate message to host byte status

Instead of setting the message byte translate it to the appropriate host
byte. As error recovery would return DID_ERROR for any non-zero message
byte the translation doesn't change the error handling.

[mkp: zeroday bug report: s/SCpnt->result/SCpnt/]

Link: https://lore.kernel.org/r/20210427083046.31620-33-hare@suse.deSigned-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ac87ee0a
...@@ -2042,8 +2042,10 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result) ...@@ -2042,8 +2042,10 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result)
{ {
info->stats.fins += 1; info->stats.fins += 1;
SCpnt->result = result << 16 | info->scsi.SCp.Message << 8 | set_host_byte(SCpnt, result);
info->scsi.SCp.Status; if (result == DID_OK)
scsi_msg_to_host_byte(SCpnt, info->scsi.SCp.Message);
set_status_byte(SCpnt, info->scsi.SCp.Status);
fas216_log_command(info, LOG_CONNECT, SCpnt, fas216_log_command(info, LOG_CONNECT, SCpnt,
"command complete, result=0x%08x", SCpnt->result); "command complete, result=0x%08x", SCpnt->result);
...@@ -2051,8 +2053,7 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result) ...@@ -2051,8 +2053,7 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result)
/* /*
* If the driver detected an error, we're all done. * If the driver detected an error, we're all done.
*/ */
if (host_byte(SCpnt->result) != DID_OK || if (get_host_byte(SCpnt) != DID_OK)
msg_byte(SCpnt->result) != COMMAND_COMPLETE)
goto done; goto done;
/* /*
......
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