scsi.c (712cba5d87a6c0e980ee5fad45734e189c4d7151) scsi.c (cbbd26b8b1a6af9c02e2b6523e12bd50cc765059)
1/*******************************************************************************
2 * Vhost kernel TCM fabric driver for virtio SCSI initiators
3 *
4 * (C) Copyright 2010-2013 Datera, Inc.
5 * (C) Copyright 2010-2012 IBM Corp.
6 *
7 * Licensed to the Linux Foundation under the General Public License (GPL) version 2.
8 *

--- 908 unchanged lines hidden (view full) ---

917 * WRITE payloads.
918 *
919 * copy_from_iter() will advance out_iter, so that it will
920 * point at the start of the outgoing WRITE payload, if
921 * DMA_TO_DEVICE is set.
922 */
923 iov_iter_init(&out_iter, WRITE, vq->iov, out, out_size);
924
1/*******************************************************************************
2 * Vhost kernel TCM fabric driver for virtio SCSI initiators
3 *
4 * (C) Copyright 2010-2013 Datera, Inc.
5 * (C) Copyright 2010-2012 IBM Corp.
6 *
7 * Licensed to the Linux Foundation under the General Public License (GPL) version 2.
8 *

--- 908 unchanged lines hidden (view full) ---

917 * WRITE payloads.
918 *
919 * copy_from_iter() will advance out_iter, so that it will
920 * point at the start of the outgoing WRITE payload, if
921 * DMA_TO_DEVICE is set.
922 */
923 iov_iter_init(&out_iter, WRITE, vq->iov, out, out_size);
924
925 ret = copy_from_iter(req, req_size, &out_iter);
926 if (unlikely(ret != req_size)) {
925 if (unlikely(!copy_from_iter_full(req, req_size, &out_iter))) {
927 vq_err(vq, "Faulted on copy_from_iter\n");
928 vhost_scsi_send_bad_target(vs, vq, head, out);
929 continue;
930 }
931 /* virtio-scsi spec requires byte 0 of the lun to be 1 */
932 if (unlikely(*lunp != 1)) {
933 vq_err(vq, "Illegal virtio-scsi lun: %u\n", *lunp);
934 vhost_scsi_send_bad_target(vs, vq, head, out);

--- 1243 unchanged lines hidden ---
926 vq_err(vq, "Faulted on copy_from_iter\n");
927 vhost_scsi_send_bad_target(vs, vq, head, out);
928 continue;
929 }
930 /* virtio-scsi spec requires byte 0 of the lun to be 1 */
931 if (unlikely(*lunp != 1)) {
932 vq_err(vq, "Illegal virtio-scsi lun: %u\n", *lunp);
933 vhost_scsi_send_bad_target(vs, vq, head, out);

--- 1243 unchanged lines hidden ---