From 5447fb12a9464f9aea6edb8ad408855cddccfdbf Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Wed, 25 Oct 2017 19:45:33 +0200 Subject: [PATCH] bdev_virtio: fix scan inquiry alloc_len Some devices expect alloc_len to be the same as payload len. Kernel vhost-scsi reports: Expected Transfer Length: 256 does not match SCSI CDB Length: 255 for SAM Opcode: 0x12. Change-Id: I499290c207b77be6757441da002f9fcc9eebcecd Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/383779 Tested-by: SPDK Automated Test System Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris Reviewed-by: Daniel Verkamp --- lib/bdev/virtio/bdev_virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bdev/virtio/bdev_virtio.c b/lib/bdev/virtio/bdev_virtio.c index ef5c9830e..8ae5a7b7b 100644 --- a/lib/bdev/virtio/bdev_virtio.c +++ b/lib/bdev/virtio/bdev_virtio.c @@ -889,7 +889,7 @@ scan_target(struct virtio_scsi_scan_base *base) cdb = (struct spdk_scsi_cdb_inquiry *)req->cdb; cdb->opcode = SPDK_SPC_INQUIRY; - cdb->alloc_len[1] = 255; + to_be16(cdb->alloc_len, BDEV_VIRTIO_SCAN_PAYLOAD_SIZE); base->retries = SCAN_REQUEST_RETRIES; return virtio_xmit_pkt(base->vq, vreq);