Commit 816e85ed authored by Byungchul Park's avatar Byungchul Park Committed by Michael S. Tsirkin

vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()

The following patch changed the behavior which originally did safe
iteration. Make it safe as it was.

   12bdcbd5
   vhost/scsi: Don't reinvent the wheel but use existing llist API
Signed-off-by: default avatarByungchul Park <byungchul.park@lge.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent c7cdff0e
...@@ -519,7 +519,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work) ...@@ -519,7 +519,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
vs_completion_work); vs_completion_work);
DECLARE_BITMAP(signal, VHOST_SCSI_MAX_VQ); DECLARE_BITMAP(signal, VHOST_SCSI_MAX_VQ);
struct virtio_scsi_cmd_resp v_rsp; struct virtio_scsi_cmd_resp v_rsp;
struct vhost_scsi_cmd *cmd; struct vhost_scsi_cmd *cmd, *t;
struct llist_node *llnode; struct llist_node *llnode;
struct se_cmd *se_cmd; struct se_cmd *se_cmd;
struct iov_iter iov_iter; struct iov_iter iov_iter;
...@@ -527,7 +527,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work) ...@@ -527,7 +527,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
bitmap_zero(signal, VHOST_SCSI_MAX_VQ); bitmap_zero(signal, VHOST_SCSI_MAX_VQ);
llnode = llist_del_all(&vs->vs_completion_list); 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; se_cmd = &cmd->tvc_se_cmd;
pr_debug("%s tv_cmd %p resid %u status %#02x\n", __func__, pr_debug("%s tv_cmd %p resid %u status %#02x\n", __func__,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment