2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-06 12:44:14 +08:00
linux-next/drivers/net/hyperv
Vitaly Kuznetsov d072218f21 hv_netvsc: avoid deadlocks between rtnl lock and vf_use_cnt wait
Here is a deadlock scenario:
- netvsc_vf_up() schedules netvsc_notify_peers() work and quits.
- netvsc_vf_down() runs before netvsc_notify_peers() gets executed. As it
  is being executed from netdev notifier chain we hold rtnl lock when we
  get here.
- we enter while (atomic_read(&net_device_ctx->vf_use_cnt) != 0) loop and
  wait till netvsc_notify_peers() drops vf_use_cnt.
- netvsc_notify_peers() starts on some other CPU but netdev_notify_peers()
  will hang on rtnl_lock().
- deadlock!

Instead of introducing additional synchronization I suggest we drop
gwrk.dwrk completely and call NETDEV_NOTIFY_PEERS directly. As we're
acting under rtnl lock this is legitimate.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-08-15 13:48:07 -07:00
..
hyperv_net.h hv_netvsc: avoid deadlocks between rtnl lock and vf_use_cnt wait 2016-08-15 13:48:07 -07:00
Kconfig
Makefile
netvsc_drv.c hv_netvsc: avoid deadlocks between rtnl lock and vf_use_cnt wait 2016-08-15 13:48:07 -07:00
netvsc.c hv_netvsc: don't lose VF information 2016-08-15 13:48:07 -07:00
rndis_filter.c netvsc: get rid of completion timeouts 2016-06-09 11:40:05 -07:00