Commit 9aacf6fe authored by John Garry's avatar John Garry Committed by Martin K. Petersen

scsi: libsas: Handle non-TMF codes in sas_scsi_find_task()

LLDD TMF callbacks may return linux or other error codes instead of TMF
codes. This may cause problems in sas_scsi_find_task() ->
.lldd_query_task(), as only TMF codes are handled there. As such, we may
not return a task_disposition type from sas_scsi_find_task(). Function
sas_eh_handle_sas_errors() only handles that type, and will only progress
error handling for those recognised types.

Return TASK_ABORT_FAILED upon exit on the assumption that the command may
still be alive and error handling should be escalated.

Link: https://lore.kernel.org/r/1645112566-115804-2-git-send-email-john.garry@huawei.comTested-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ac2beb4e
...@@ -316,11 +316,13 @@ static enum task_disposition sas_scsi_find_task(struct sas_task *task) ...@@ -316,11 +316,13 @@ static enum task_disposition sas_scsi_find_task(struct sas_task *task)
pr_notice("%s: task 0x%p failed to abort\n", pr_notice("%s: task 0x%p failed to abort\n",
__func__, task); __func__, task);
return TASK_ABORT_FAILED; return TASK_ABORT_FAILED;
default:
pr_notice("%s: task 0x%p result code %d not handled\n",
__func__, task, res);
} }
} }
} }
return res; return TASK_ABORT_FAILED;
} }
static int sas_recover_lu(struct domain_device *dev, struct scsi_cmnd *cmd) static int sas_recover_lu(struct domain_device *dev, struct scsi_cmnd *cmd)
......
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