|
@@ -964,7 +964,8 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
|
|
prot_bytes = vhost32_to_cpu(vq, v_req_pi.pi_bytesin);
|
|
prot_bytes = vhost32_to_cpu(vq, v_req_pi.pi_bytesin);
|
|
}
|
|
}
|
|
/*
|
|
/*
|
|
- * Set prot_iter to data_iter, and advance past any
|
|
|
|
|
|
+ * Set prot_iter to data_iter and truncate it to
|
|
|
|
+ * prot_bytes, and advance data_iter past any
|
|
* preceeding prot_bytes that may be present.
|
|
* preceeding prot_bytes that may be present.
|
|
*
|
|
*
|
|
* Also fix up the exp_data_len to reflect only the
|
|
* Also fix up the exp_data_len to reflect only the
|
|
@@ -973,6 +974,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
|
|
if (prot_bytes) {
|
|
if (prot_bytes) {
|
|
exp_data_len -= prot_bytes;
|
|
exp_data_len -= prot_bytes;
|
|
prot_iter = data_iter;
|
|
prot_iter = data_iter;
|
|
|
|
+ iov_iter_truncate(&prot_iter, prot_bytes);
|
|
iov_iter_advance(&data_iter, prot_bytes);
|
|
iov_iter_advance(&data_iter, prot_bytes);
|
|
}
|
|
}
|
|
tag = vhost64_to_cpu(vq, v_req_pi.tag);
|
|
tag = vhost64_to_cpu(vq, v_req_pi.tag);
|