virtio_scsi: do not overwrite SCSI status
Subsystems (2)
PATCH v2 1/1 virtio_scsi: do not overwrite SCSI status
When a sense code is present we should not override the scsi status; the driver already sets it based on the response from the hypervisor.
--- drivers/scsi/virtio_scsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/virtio_scsi.c +1 -2
@@ -156,12 +156,11 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf)WARN_ON (virtio32_to_cpu (vscsi->vdev, resp->sense_len) >VIRTIO_SCSI_SENSE_SIZE ); -if (sc->sense_buffer) { +if (resp->sense_len) {memcpy (sc->sense_buffer, resp->sense,min_t (u32,virtio32_to_cpu (vscsi->vdev, resp->sense_len),VIRTIO_SCSI_SENSE_SIZE )); -set_status_byte (sc,SAM_STAT_CHECK_CONDITION ); } sc->scsi_done (sc);
Signature · 1 line
2.29.2
Martin K. Petersen
AppliedHannes,
Quoted 2 lines
When a sense code is present we should not override the scsi status; the driver already sets it based on the response from the hypervisor.
Applied to 5.14/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
PATCH v2 1/1 virtio_scsi: do not overwrite SCSI status
Quoted 1 line
Applied to 5.14/scsi-staging, thanks!
This fixes virtio-scsi for me.
Thanks.
Martin K. Petersen
AppliedQuoted 2 lines · Hannes Reinecke
When a sense code is present we should not override the scsi status; the driver already sets it based on the response from the hypervisor.
Applied to 5.14/scsi-queue, thanks!
[1/1] virtio_scsi: do not overwrite SCSI status
https://git.kernel.org/mkp/scsi/c/c43ddbf97f46
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Hi,
Quoted 8 lines · Hannes Reinecke
When a sense code is present we should not override the scsi status; the driver already sets it based on the response from the hypervisor.
Fixes 464a00c9e0ad ("scsi: core: Kill DRIVER_SENSE")Signed-off-by Hannes Reinecke <[email protected]>Tested-by Guenter Roeck <[email protected]>Tested-by Jiri Slaby <[email protected]>
This patch didn't make it into mainline, but commit 464a00c9e0ad is there. This means that virtio_scsi is now broken in mainline (as of v5.13-9356-g4b820e167bf6). Did it get lost, or is it still queued somewhere ?
Thanks,
Guenter
Quoted 22 lines
--- drivers/scsi/virtio_scsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/scsi/virtio_scsi.c +1
-2@@ -156,12 +156,11 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf)WARN_ON (virtio32_to_cpu (vscsi->vdev, resp->sense_len) >VIRTIO_SCSI_SENSE_SIZE ); -if (sc->sense_buffer) { +if (resp->sense_len) {memcpy (sc->sense_buffer, resp->sense,min_t (u32,virtio32_to_cpu (vscsi->vdev, resp->sense_len),VIRTIO_SCSI_SENSE_SIZE )); -set_status_byte (sc,SAM_STAT_CHECK_CONDITION ); } sc->scsi_done (sc);
Guenter,
Quoted 4 lines
This patch didn't make it into mainline, but commit
464a00c9e0adis there. This means thatvirtio_scsiis now broken in mainline (as of v5.13-9356-g4b820e167bf6). Did it get lost, or is it still queued somewhere ?
It's still in 5.14/scsi-queue:
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git/log/?h=5.14/scsi-queue
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering