]> git.ipfire.org Git - thirdparty/linux.git/commit
vhost-scsi: Fix vhost_scsi_send_bad_target()
authorDongli Zhang <dongli.zhang@oracle.com>
Thu, 3 Apr 2025 06:29:47 +0000 (23:29 -0700)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 18 Apr 2025 14:08:11 +0000 (10:08 -0400)
commitb182687135474d7ed905a07cc6cb2734b359e13e
treeec316f1ace1e99df2b798f9c8e65487e36a1a941
parentf591cf9fce724e5075cc67488c43c6e39e8cbe27
vhost-scsi: Fix vhost_scsi_send_bad_target()

Although the support of VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 was
signaled by the commit 664ed90e621c ("vhost/scsi: Set
VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits"),
vhost_scsi_send_bad_target() still assumes the response in a single
descriptor.

In addition, although vhost_scsi_send_bad_target() is used by both I/O
queue and control queue, the response header is always
virtio_scsi_cmd_resp. It is required to use virtio_scsi_ctrl_tmf_resp or
virtio_scsi_ctrl_an_resp for control queue.

Fixes: 664ed90e621c ("vhost/scsi: Set VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits")
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Message-Id: <20250403063028.16045-3-dongli.zhang@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/scsi.c