Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729914

[PATCH 1/5] vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister()

From kys@exchange.microsoft.com
Newsgroups linux.kernel
Subject [PATCH 1/5] vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister()
Date 2017-09-10 08:20 +0200
Message-ID <uo3L4-89U-5@gated-at.bofh.it> (permalink)
References <uo3rJ-7MG-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Dexuan Cui <decui@microsoft.com>

Due to commit 54a66265d675 ("Drivers: hv: vmbus: Fix rescind handling"),
we need this patch to resolve the below deadlock:

after we get the mutex in vmbus_hvsock_device_unregister() and call
vmbus_device_unregister() -> device_unregister() -> ... -> device_release()
-> vmbus_device_release(), we'll get a deadlock, because
vmbus_device_release() tries to get the same mutex.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/hv/channel_mgmt.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 968af173c4c1..624d815745e4 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -945,14 +945,10 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr)
 
 void vmbus_hvsock_device_unregister(struct vmbus_channel *channel)
 {
-	mutex_lock(&vmbus_connection.channel_mutex);
-
 	BUG_ON(!is_hvsock_channel(channel));
 
 	channel->rescind = true;
 	vmbus_device_unregister(channel->device_obj);
-
-	mutex_unlock(&vmbus_connection.channel_mutex);
 }
 EXPORT_SYMBOL_GPL(vmbus_hvsock_device_unregister);
 
-- 
2.14.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] Drivers: hv: Miscellaneous fixes  kys@exchange.microsoft.com - 2017-09-10 08:00 +0200
  [PATCH 3/5] Drivers: hv: fcopy: restore correct transfer length kys@exchange.microsoft.com - 2017-09-10 08:20 +0200
  [PATCH 2/5] vmbus: suppress uevents for hv_sock devices kys@exchange.microsoft.com - 2017-09-10 08:20 +0200
    Re: [PATCH 2/5] vmbus: suppress uevents for hv_sock devices Greg KH <gregkh@linuxfoundation.org> - 2017-09-10 11:30 +0200
      RE: [PATCH 2/5] vmbus: suppress uevents for hv_sock devices KY Srinivasan <kys@microsoft.com> - 2017-09-18 02:10 +0200
  [PATCH 4/5] vmbus: add per-channel sysfs info kys@exchange.microsoft.com - 2017-09-10 08:20 +0200
  [PATCH 1/5] vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister() kys@exchange.microsoft.com - 2017-09-10 08:20 +0200
    [PATCH 5/5] Drivers: hv: vmbus: Expose per-channel event counters  kys@exchange.microsoft.com - 2017-09-10 08:20 +0200

csiph-web