[linux-yocto] [PATCH 10/10] vhost-scsi: Include prot_bytes into expected data transfer length

zhe.he at windriver.com zhe.he at windriver.com
Wed Aug 20 22:57:40 PDT 2014


From: Nicholas Bellinger <nab at linux-iscsi.org>

commit 9f977ef7b671f6169eca78bf40f230fe84b7c7e5 upstream

This patch updates vhost_scsi_get_tag() to accept the combined
expected data transfer length + T10 PI bytes as the value passed
into target_submit_cmd().

This is required now that target-core logic in commit 14ef9200
expects to subtract se_cmd->prot_length from se_cmd->data_length.

Cc: Paolo Bonzini <pbonzini at redhat.com>
Cc: Michael S. Tsirkin <mst at redhat.com>
Cc: Martin K. Petersen <martin.petersen at oracle.com>
Cc: Sagi Grimberg <sagig at mellanox.com>
Signed-off-by: Nicholas Bellinger <nab at linux-iscsi.org>
Signed-off-by: He Zhe <zhe.he at windriver.com>
---
 drivers/vhost/scsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 3671d65..6a52818 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1139,7 +1139,8 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
 		}
 
 		cmd = vhost_scsi_get_tag(vq, tpg, cdb, tag, lun, task_attr,
-					 exp_data_len, data_direction);
+					 exp_data_len + prot_bytes,
+					 data_direction);
 		if (IS_ERR(cmd)) {
 			vq_err(vq, "vhost_scsi_get_tag failed %ld\n",
 					PTR_ERR(cmd));
-- 
1.9.1



More information about the linux-yocto mailing list