scsi: virtio_scsi: Drop DID_TARGET_FAILURE use
authorMike Christie <michael.christie@oracle.com>
Fri, 12 Aug 2022 01:00:21 +0000 (20:00 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 7 Sep 2022 02:05:58 +0000 (22:05 -0400)
commitbeb4dac8d23546c14c77fce724a214348523d503
tree085fabc762f890a6c9951002c4bb5cb3ee8e8bbe
parentf1d0d5c9fe37d45e5f3004e54a4e596220bae930
scsi: virtio_scsi: Drop DID_TARGET_FAILURE use

DID_TARGET_FAILURE is internal to the SCSI layer. Drivers must not use it
because:

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

 2. There is no handling for it in scsi_decide_disposition() so it results
    in entering SCSI error handling.

virtio_scsi gets this when something like qemu returns
VIRTIO_SCSI_S_TARGET_FAILURE.  It looks like qemu returns that error code
if a host OS returns it, but this shouldn't happen for Linux since we never
propagate that error to userspace.

This has us use DID_BAD_TARGET in case some other virt layer is returning
it. In that case we will still get a hard error like before and it conveys
something unexpected happened.

Link: https://lore.kernel.org/r/20220812010027.8251-5-michael.christie@oracle.com
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/virtio_scsi.c