Skip to content

Commit 816e85e

Browse files
lgebyungchulparkmstsirkin
authored andcommitted
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. 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>
1 parent c7cdff0 commit 816e85e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/vhost/scsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,15 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work)
519519
vs_completion_work);
520520
DECLARE_BITMAP(signal, VHOST_SCSI_MAX_VQ);
521521
struct virtio_scsi_cmd_resp v_rsp;
522-
struct vhost_scsi_cmd *cmd;
522+
struct vhost_scsi_cmd *cmd, *t;
523523
struct llist_node *llnode;
524524
struct se_cmd *se_cmd;
525525
struct iov_iter iov_iter;
526526
int ret, vq;
527527

528528
bitmap_zero(signal, VHOST_SCSI_MAX_VQ);
529529
llnode = llist_del_all(&vs->vs_completion_list);
530-
llist_for_each_entry(cmd, llnode, tvc_completion_list) {
530+
llist_for_each_entry_safe(cmd, t, llnode, tvc_completion_list) {
531531
se_cmd = &cmd->tvc_se_cmd;
532532

533533
pr_debug("%s tv_cmd %p resid %u status %#02x\n", __func__,

0 commit comments

Comments
 (0)