scsi: xen: Drop use of internal host codes
authorMike Christie <michael.christie@oracle.com>
Fri, 12 Aug 2022 01:00:18 +0000 (20:00 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 7 Sep 2022 02:05:58 +0000 (22:05 -0400)
The error codes:

 - DID_TARGET_FAILURE

 - DID_NEXUS_FAILURE

 - DID_ALLOC_FAILURE

 - DID_MEDIUM_ERROR

are internal to the SCSI layer. Drivers must not use them because:

 1. They are not propagated upwards, so SG IO/passthrough users will not
    see an error and think a command was successful.

    xen-scsiback will never see this error and should not try to send it.

 2. There is no handling for them in scsi_decide_disposition() so if
    xen-scsifront were to return the error to the SCSI midlayer then it
    kicks off the error handler which is definitely not what we want.

Remove the use from xen-scsifront/back.

Link: https://lore.kernel.org/r/20220812010027.8251-2-michael.christie@oracle.com
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/xen-scsifront.c
drivers/xen/xen-scsiback.c

index 51afc66e839d71f51d558f7b17d9ff67930f284a..66b316d173b0b4155b26c2d64d5d5213e3c6fdec 100644 (file)
@@ -289,14 +289,6 @@ static unsigned int scsifront_host_byte(int32_t rslt)
                return DID_TRANSPORT_DISRUPTED;
        case XEN_VSCSIIF_RSLT_HOST_TRANSPORT_FAILFAST:
                return DID_TRANSPORT_FAILFAST;
-       case XEN_VSCSIIF_RSLT_HOST_TARGET_FAILURE:
-               return DID_TARGET_FAILURE;
-       case XEN_VSCSIIF_RSLT_HOST_NEXUS_FAILURE:
-               return DID_NEXUS_FAILURE;
-       case XEN_VSCSIIF_RSLT_HOST_ALLOC_FAILURE:
-               return DID_ALLOC_FAILURE;
-       case XEN_VSCSIIF_RSLT_HOST_MEDIUM_ERROR:
-               return DID_MEDIUM_ERROR;
        case XEN_VSCSIIF_RSLT_HOST_TRANSPORT_MARGINAL:
                return DID_TRANSPORT_MARGINAL;
        default:
index 7a0c93acc2c5760335c072d929c7d59d4102b357..e98c88a960d87bf48a99330b0fc029b4589166a4 100644 (file)
@@ -333,18 +333,6 @@ static int32_t scsiback_result(int32_t result)
        case DID_TRANSPORT_FAILFAST:
                host_status = XEN_VSCSIIF_RSLT_HOST_TRANSPORT_FAILFAST;
                break;
-       case DID_TARGET_FAILURE:
-               host_status = XEN_VSCSIIF_RSLT_HOST_TARGET_FAILURE;
-               break;
-       case DID_NEXUS_FAILURE:
-               host_status = XEN_VSCSIIF_RSLT_HOST_NEXUS_FAILURE;
-               break;
-       case DID_ALLOC_FAILURE:
-               host_status = XEN_VSCSIIF_RSLT_HOST_ALLOC_FAILURE;
-               break;
-       case DID_MEDIUM_ERROR:
-               host_status = XEN_VSCSIIF_RSLT_HOST_MEDIUM_ERROR;
-               break;
        case DID_TRANSPORT_MARGINAL:
                host_status = XEN_VSCSIIF_RSLT_HOST_TRANSPORT_MARGINAL;
                break;