Skip to content

Commit

Permalink
vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
Browse files Browse the repository at this point in the history
The following patch changed the behavior which originally did safe
iteration. Make it safe as it was.

   12bdcbd
   vhost/scsi: Don't reinvent the wheel but use existing llist API

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Byungchul Park authored and Michael S. Tsirkin committed Nov 14, 2017
1 parent c7cdff0 commit 816e85e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/vhost/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,15 @@ 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;
int ret, vq;

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__,
Expand Down

0 comments on commit 816e85e

Please sign in to comment.