diff options
author | stephen hemminger <stephen@networkplumber.org> | 2017-08-03 17:13:54 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-06 21:23:21 -0700 |
commit | 732e49850c5e15231e11a0a464748bcbade5e3c2 (patch) | |
tree | 5d000b7307ee1935be7492297897bf4bbb30c6ca /drivers/net/hyperv/hyperv_net.h | |
parent | 2c460621bb2e6baf8a475c407cdb29029b2497ac (diff) | |
download | linux-732e49850c5e15231e11a0a464748bcbade5e3c2.tar.gz linux-732e49850c5e15231e11a0a464748bcbade5e3c2.tar.bz2 linux-732e49850c5e15231e11a0a464748bcbade5e3c2.zip |
netvsc: fix race on sub channel creation
The existing sub channel code did not wait for all the sub-channels
to completely initialize. This could lead to race causing crash
in napi_netif_del() from bad list. The existing code would send
an init message, then wait only for the initial response that
the init message was received. It thought it was waiting for
sub channels but really the init response did the wakeup.
The new code keeps track of the number of open channels and
waits until that many are open.
Other issues here were:
* host might return less sub-channels than was requested.
* the new init status is not valid until after init was completed.
Fixes: b3e6b82a0099 ("hv_netvsc: Wait for sub-channels to be processed during probe")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/hyperv_net.h')
-rw-r--r-- | drivers/net/hyperv/hyperv_net.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index d6c25580f8dd..12cc64bfcff8 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -765,7 +765,8 @@ struct netvsc_device { u32 max_chn; u32 num_chn; - refcount_t sc_offered; + atomic_t open_chn; + wait_queue_head_t subchan_open; struct rndis_device *extension; |