Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Drivers: hv: vmbus: Handle channel rescind message correctly

Properly cleanup the channel state on receipt of the "offer rescind" message.
Starting with ws2012, the host requires that the channel "relid" be properly
cleaned up when the offer is rescinded.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

K. Y. Srinivasan and committed by
Greg Kroah-Hartman
c8705979 1cac8cd4

+11
+11
drivers/hv/channel_mgmt.c
··· 165 165 struct vmbus_channel *channel = container_of(work, 166 166 struct vmbus_channel, 167 167 work); 168 + unsigned long flags; 169 + struct vmbus_channel_relid_released msg; 168 170 169 171 vmbus_device_unregister(channel->device_obj); 172 + memset(&msg, 0, sizeof(struct vmbus_channel_relid_released)); 173 + msg.child_relid = channel->offermsg.child_relid; 174 + msg.header.msgtype = CHANNELMSG_RELID_RELEASED; 175 + vmbus_post_msg(&msg, sizeof(struct vmbus_channel_relid_released)); 176 + 177 + spin_lock_irqsave(&vmbus_connection.channel_lock, flags); 178 + list_del(&channel->listentry); 179 + spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); 180 + free_channel(channel); 170 181 } 171 182 172 183 void vmbus_free_channels(void)