Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-block.git] / drivers / vhost / scsi.c
index e5b18320f1a337c6b3810e147ad5dec634b5f09e..71517b3c55582266becd3f0aa2639664c96f5148 100644 (file)
@@ -513,7 +513,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
                                        vs_completion_work);
        DECLARE_BITMAP(signal, VHOST_SCSI_MAX_VQ);
        struct virtio_scsi_cmd_resp v_rsp;
-       struct vhost_scsi_cmd *cmd;
+       struct vhost_scsi_cmd *cmd, *t;
        struct llist_node *llnode;
        struct se_cmd *se_cmd;
        struct iov_iter iov_iter;
@@ -521,7 +521,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
 
        bitmap_zero(signal, VHOST_SCSI_MAX_VQ);
        llnode = llist_del_all(&vs->vs_completion_list);
-       llist_for_each_entry(cmd, llnode, tvc_completion_list) {
+       llist_for_each_entry_safe(cmd, t, llnode, tvc_completion_list) {
                se_cmd = &cmd->tvc_se_cmd;
 
                pr_debug("%s tv_cmd %p resid %u status %#02x\n", __func__,
@@ -902,7 +902,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
                        continue;
                }
 
-               tpg = ACCESS_ONCE(vs_tpg[*target]);
+               tpg = READ_ONCE(vs_tpg[*target]);
                if (unlikely(!tpg)) {
                        /* Target does not exist, fail the request */
                        vhost_scsi_send_bad_target(vs, vq, head, out);