Skip to content

Commit

Permalink
vhost_net: stop device during reset owner
Browse files Browse the repository at this point in the history
[ Upstream commit 4cd8795 ]

We don't stop device before reset owner, this means we could try to
serve any virtqueue kick before reset dev->worker. This will result a
warn since the work was pending at llist during owner resetting. Fix
this by stopping device during owner reset.

Reported-by: [email protected]
Fixes: 3a4d5c9 ("vhost_net: a kernel-level virtio server")
Signed-off-by: Jason Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
jasowang authored and gregkh committed Feb 16, 2018
1 parent cde3537 commit 8cec497
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/vhost/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ static long vhost_net_reset_owner(struct vhost_net *n)
}
vhost_net_stop(n, &tx_sock, &rx_sock);
vhost_net_flush(n);
vhost_dev_stop(&n->dev);
vhost_dev_reset_owner(&n->dev, memory);
vhost_net_vq_reset(n);
done:
Expand Down

0 comments on commit 8cec497

Please sign in to comment.