Commit 0d5b7138 authored by Jason Wang's avatar Jason Wang Committed by sanglipeng
Browse files

virtio-net: set queues after driver_ok

stable inclusion
from stable-v5.10.192
commit 9aead733f5e0d40e3d2798f4d2fd4a5d7930111c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I933RF

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9aead733f5e0d40e3d2798f4d2fd4a5d7930111c



--------------------------------

commit 51b81317 upstream.

Commit 25266128 ("virtio-net: fix race between set queues and
probe") tries to fix the race between set queues and probe by calling
_virtnet_set_queues() before DRIVER_OK is set. This violates virtio
spec. Fixing this by setting queues after virtio_device_ready().

Note that rtnl needs to be held for userspace requests to change the
number of queues. So we are serialized in this way.

Fixes: 25266128 ("virtio-net: fix race between set queues and probe")
Reported-by: default avatarDragos Tatulea <dtatulea@nvidia.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent a47141d3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment