Drivers: hv: vmbus: serialize process_chn_event() and vmbus_close_internal()
authorDexuan Cui <decui@microsoft.com>
Tue, 15 Dec 2015 00:01:47 +0000 (16:01 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Dec 2015 03:15:05 +0000 (19:15 -0800)
commit63d55b2aeb5e4faa170316fee73c3c47ea9268c7
tree3bbb112423731bce267feff4dd224dfe635dfdda
parentefc267226b827f347a329c395e16c08973b0e3d6
Drivers: hv: vmbus: serialize process_chn_event() and vmbus_close_internal()

process_chn_event(), running in the tasklet, can race with
vmbus_close_internal() in the case of SMP guest, e.g., when the former is
accessing channel->inbound.ring_buffer, the latter could be freeing the
ring_buffer pages.

To resolve the race, we can serialize them by disabling the tasklet when
the latter is running here.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/channel.c