diff options
-rw-r--r-- | drivers/vhost/scsi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 27c9dac9f518..a9caf1bc3c3e 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c | |||
@@ -918,7 +918,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) | |||
918 | struct iov_iter in_iter, prot_iter, data_iter; | 918 | struct iov_iter in_iter, prot_iter, data_iter; |
919 | u64 tag; | 919 | u64 tag; |
920 | u32 exp_data_len, data_direction; | 920 | u32 exp_data_len, data_direction; |
921 | int ret, prot_bytes; | 921 | int ret, prot_bytes, c = 0; |
922 | u16 lun; | 922 | u16 lun; |
923 | u8 task_attr; | 923 | u8 task_attr; |
924 | bool t10_pi = vhost_has_feature(vq, VIRTIO_SCSI_F_T10_PI); | 924 | bool t10_pi = vhost_has_feature(vq, VIRTIO_SCSI_F_T10_PI); |
@@ -938,7 +938,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) | |||
938 | 938 | ||
939 | vhost_disable_notify(&vs->dev, vq); | 939 | vhost_disable_notify(&vs->dev, vq); |
940 | 940 | ||
941 | for (;;) { | 941 | do { |
942 | ret = vhost_scsi_get_desc(vs, vq, &vc); | 942 | ret = vhost_scsi_get_desc(vs, vq, &vc); |
943 | if (ret) | 943 | if (ret) |
944 | goto err; | 944 | goto err; |
@@ -1118,7 +1118,7 @@ err: | |||
1118 | break; | 1118 | break; |
1119 | else if (ret == -EIO) | 1119 | else if (ret == -EIO) |
1120 | vhost_scsi_send_bad_target(vs, vq, vc.head, vc.out); | 1120 | vhost_scsi_send_bad_target(vs, vq, vc.head, vc.out); |
1121 | } | 1121 | } while (likely(!vhost_exceeds_weight(vq, ++c, 0))); |
1122 | out: | 1122 | out: |
1123 | mutex_unlock(&vq->mutex); | 1123 | mutex_unlock(&vq->mutex); |
1124 | } | 1124 | } |
@@ -1177,7 +1177,7 @@ vhost_scsi_ctl_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) | |||
1177 | } v_req; | 1177 | } v_req; |
1178 | struct vhost_scsi_ctx vc; | 1178 | struct vhost_scsi_ctx vc; |
1179 | size_t typ_size; | 1179 | size_t typ_size; |
1180 | int ret; | 1180 | int ret, c = 0; |
1181 | 1181 | ||
1182 | mutex_lock(&vq->mutex); | 1182 | mutex_lock(&vq->mutex); |
1183 | /* | 1183 | /* |
@@ -1191,7 +1191,7 @@ vhost_scsi_ctl_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) | |||
1191 | 1191 | ||
1192 | vhost_disable_notify(&vs->dev, vq); | 1192 | vhost_disable_notify(&vs->dev, vq); |
1193 | 1193 | ||
1194 | for (;;) { | 1194 | do { |
1195 | ret = vhost_scsi_get_desc(vs, vq, &vc); | 1195 | ret = vhost_scsi_get_desc(vs, vq, &vc); |
1196 | if (ret) | 1196 | if (ret) |
1197 | goto err; | 1197 | goto err; |
@@ -1270,7 +1270,7 @@ err: | |||
1270 | break; | 1270 | break; |
1271 | else if (ret == -EIO) | 1271 | else if (ret == -EIO) |
1272 | vhost_scsi_send_bad_target(vs, vq, vc.head, vc.out); | 1272 | vhost_scsi_send_bad_target(vs, vq, vc.head, vc.out); |
1273 | } | 1273 | } while (likely(!vhost_exceeds_weight(vq, ++c, 0))); |
1274 | out: | 1274 | out: |
1275 | mutex_unlock(&vq->mutex); | 1275 | mutex_unlock(&vq->mutex); |
1276 | } | 1276 | } |