diff mbox

[azure,02/14] UBUNTU: SAUCE: vmbus: add the matching tasklet_enable() in vmbus_close_internal()

Message ID 1497979654-27251-3-git-send-email-marcelo.cerri@canonical.com
State New
Headers show

Commit Message

Marcelo Henrique Cerri June 20, 2017, 5:27 p.m. UTC
From: Dexuan Cui <decui@microsoft.com>

BugLink: http://bugs.launchpad.net/bugs/1698425

If we disable a tasklet that is scheduled but hasn't started to run,
the tasklet has no chance to run any longer, so later we'll hang
in free_channel() -> tasklet_kill(), because the TASKLET_STATE_SCHED
can't be cleared in tasklet_action().

With the patch, before free_channel() -> tasklet_kill() returns, the
tasklet still has a chance to run with a NULL channel->onchannel_callback,
which will be ignored safely, e.g. by vmbus_on_event().

Fixes: dad72a1d2844 ("vmbus: remove hv_event_tasklet_disable/enable")

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: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
---
 drivers/hv/channel.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index 5f91e6b8eb01..334b8d83c0df 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -608,6 +608,7 @@  static int vmbus_close_internal(struct vmbus_channel *channel)
 		get_order(channel->ringbuffer_pagecount * PAGE_SIZE));
 
 out:
+	tasklet_enable(&channel->callback_event);
 	return ret;
 }