All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Mike Christie <michael.christie@oracle.com>
Cc: jgross@suse.com, njavali@marvell.com, pbonzini@redhat.com,
	jasowang@redhat.com, stefanha@redhat.com, oneukum@suse.com,
	manoj@linux.ibm.com, mrochs@linux.ibm.com, ukrishn@linux.ibm.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	james.bottomley@hansenpartnership.com
Subject: Re: [PATCH 05/10] scsi: virtio_scsi: Drop DID_NEXUS_FAILURE use.
Date: Tue, 9 Aug 2022 15:40:37 -0400	[thread overview]
Message-ID: <20220809154011-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20220804034100.121125-6-michael.christie@oracle.com>

On Wed, Aug 03, 2022 at 10:40:55PM -0500, Mike Christie wrote:
> DID_NEXUS_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 them in scsi_decide_disposition so it results
> in the scsi eh running.
> 
> It looks like virtio_scsi gets this when something like qemu returns
> VIRTIO_SCSI_S_NEXUS_FAILURE. It looks like qemu returns that error code
> if host OS returns DID_NEXUS_FAILURE (qemu's internal
> SCSI_HOST_RESERVATION_ERROR maps to DID_NEXUS_FAILURE). This shouldn't
> happen for linux since we don't propagate that error code to userspace.
> 
> This has us convert VIRTIO_SCSI_S_NEXUS_FAILURE to a
> SAM_STAT_RESERVATION_CONFLICT in case some other virt layer is returning
> it. In that case we will still get the reservation confict failure we
> expect.
> 
> Signed-off-by: Mike Christie <michael.christie@oracle.com>

If everyone drops it, so should virtio

so

Acked-by: Michael S. Tsirkin <mst@redhat.com>

but pls merge with rest of the patchset.

> ---
>  drivers/scsi/virtio_scsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
> index 112d8c3962b0..00cf6743db8c 100644
> --- a/drivers/scsi/virtio_scsi.c
> +++ b/drivers/scsi/virtio_scsi.c
> @@ -144,7 +144,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf)
>  		set_host_byte(sc, DID_BAD_TARGET);
>  		break;
>  	case VIRTIO_SCSI_S_NEXUS_FAILURE:
> -		set_host_byte(sc, DID_NEXUS_FAILURE);
> +		set_status_byte(sc, SAM_STAT_RESERVATION_CONFLICT);
>  		break;
>  	default:
>  		scmd_printk(KERN_WARNING, sc, "Unknown response %d",
> -- 
> 2.25.1


  parent reply	other threads:[~2022-08-09 19:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04  3:40 [PATCH 00/10] scsi: Fix internal host code use Mike Christie
2022-08-04  3:40 ` [PATCH 01/10] scsi: xen: Drop use of internal host codes Mike Christie
2022-08-04  6:18   ` Juergen Gross
2022-08-04 16:28     ` Mike Christie
2022-08-04 17:00       ` Juergen Gross
2022-08-04  3:40 ` [PATCH 02/10] scsi: storvsc: Drop DID_TARGET_FAILURE use Mike Christie
2022-08-04  3:40 ` [PATCH 03/10] scsi: uas: " Mike Christie
2022-08-04 18:59   ` Mike Christie
2022-08-04 21:07     ` Hans de Goede
2022-08-04  3:40 ` [PATCH 04/10] scsi: virtio_scsi: " Mike Christie
2022-08-04 18:25   ` Paolo Bonzini
2022-08-09 19:40   ` Michael S. Tsirkin
2022-08-04  3:40 ` [PATCH 05/10] scsi: virtio_scsi: Drop DID_NEXUS_FAILURE use Mike Christie
2022-08-04 18:25   ` Paolo Bonzini
2022-08-09 19:40   ` Michael S. Tsirkin [this message]
2022-08-04  3:40 ` [PATCH 06/10] scsi: qla2xxx: Drop DID_TARGET_FAILURE use Mike Christie
2022-08-04  3:40 ` [PATCH 07/10] scsi: cxlflash: Drop DID_ALLOC_FAILURE use Mike Christie
2022-08-04  3:40 ` [PATCH 08/10] scsi: Add error codes for internal scsi-ml use Mike Christie
2022-08-09 20:13   ` Bart Van Assche
2022-08-10  3:18     ` Mike Christie
2022-08-04  3:40 ` [PATCH 09/10] scsi: Convert scsi_decide_disposition to use SCSIML_STAT Mike Christie
2022-08-09 20:14   ` Bart Van Assche
2022-08-04  3:41 ` [PATCH 10/10] scsi: Remove useless host error codes Mike Christie
2022-08-09 20:08   ` Bart Van Assche
2022-08-04  6:55 ` [PATCH 00/10] scsi: Fix internal host code use Oliver Neukum
2022-08-04 17:04   ` Mike Christie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220809154011-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=jasowang@redhat.com \
    --cc=jgross@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=manoj@linux.ibm.com \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=mrochs@linux.ibm.com \
    --cc=njavali@marvell.com \
    --cc=oneukum@suse.com \
    --cc=pbonzini@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=ukrishn@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.