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


Groups > linux.kernel > #1534220

[PATCH 06/15] hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels()

From kys@exchange.microsoft.com
Newsgroups linux.kernel
Subject [PATCH 06/15] hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels()
Date 2016-12-01 16:40 +0100
Message-ID <sJBCO-5Lz-37@gated-at.bofh.it> (permalink)
References <sJBCN-5Lz-9@gated-at.bofh.it> <sJBCN-5Lz-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Vitaly Kuznetsov <vkuznets@redhat.com>

"kernel BUG at drivers/hv/channel_mgmt.c:350!" is observed when hv_vmbus
module is unloaded. BUG_ON() was introduced in commit 85d9aa705184
("Drivers: hv: vmbus: add an API vmbus_hvsock_device_unregister()") as
vmbus_free_channels() codepath was apparently forgotten.

Fixes: 85d9aa705184 ("Drivers: hv: vmbus: add an API vmbus_hvsock_device_unregister()")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/hv/channel_mgmt.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index d83c1ac..e68f06c 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -390,6 +390,7 @@ void vmbus_free_channels(void)
 {
 	struct vmbus_channel *channel, *tmp;
 
+	mutex_lock(&vmbus_connection.channel_mutex);
 	list_for_each_entry_safe(channel, tmp, &vmbus_connection.chn_list,
 		listentry) {
 		/* hv_process_channel_removal() needs this */
@@ -397,6 +398,7 @@ void vmbus_free_channels(void)
 
 		vmbus_device_unregister(channel->device_obj);
 	}
+	mutex_unlock(&vmbus_connection.channel_mutex);
 }
 
 /*
-- 
1.7.4.1

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


Thread

[PATCH 00/15] Drivers: hv: CPU management fixes and a new uio driver  kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
  [PATCH 01/15] Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg() kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
    [PATCH 10/15] hv: switch to cpuhp state machine for synic init/cleanup kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
    [PATCH 14/15] uio-hv-generic: new userspace i/o driver for VMBus kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
    [PATCH 09/15] hv: change clockevents unbind tactics kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
    [PATCH 15/15] Tools: hv: kvp: configurable external scripts path kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
    [PATCH 06/15] hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels() kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
      Re: [PATCH 06/15] hv: acquire vmbus_connection.channel_mutex in  vmbus_free_channels() Greg KH <gregkh@linuxfoundation.org> - 2016-12-01 21:40 +0100
        RE: [PATCH 06/15] hv: acquire vmbus_connection.channel_mutex in  vmbus_free_channels() KY Srinivasan <kys@microsoft.com> - 2016-12-02 07:30 +0100
    [PATCH 03/15] hyperv: Fix spelling of HV_UNKOWN kys@exchange.microsoft.com - 2016-12-01 16:40 +0100
    [PATCH 11/15] hv: make CPU offlining prevention fine-grained kys@exchange.microsoft.com - 2016-12-01 16:40 +0100

csiph-web