]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Revert "Drivers: hv: vmbus: Fix a rescind handling bug"
authorTim Gardner <tim.gardner@canonical.com>
Tue, 28 Mar 2017 20:21:25 +0000 (14:21 -0600)
committerTim Gardner <tim.gardner@canonical.com>
Tue, 28 Mar 2017 20:33:42 +0000 (14:33 -0600)
BugLink: http://bugs.launchpad.net/bugs/1676635
This reverts commit 1b7d44c16f61522ee0c7b79d6f666a89c3244a5a.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/hv/channel.c
drivers/hv/channel_mgmt.c
include/linux/hyperv.h

index f63a9b809f0d328b7b41e9c899d474208c9ad05e..5fb4c6d9209b753a12dcddb4c441ff00c3e8746a 100644 (file)
@@ -157,7 +157,6 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
        }
 
        init_completion(&open_info->waitevent);
-       open_info->waiting_channel = newchannel;
 
        open_msg = (struct vmbus_channel_open_channel *)open_info->msg;
        open_msg->header.msgtype = CHANNELMSG_OPENCHANNEL;
@@ -195,11 +194,6 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
        list_del(&open_info->msglistentry);
        spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
 
-       if (newchannel->rescind) {
-               err = -ENODEV;
-               goto error_free_gpadl;
-       }
-
        if (open_info->response.open_result.status) {
                err = -EAGAIN;
                goto error_free_gpadl;
@@ -411,7 +405,6 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
                return ret;
 
        init_completion(&msginfo->waitevent);
-       msginfo->waiting_channel = channel;
 
        gpadlmsg = (struct vmbus_channel_gpadl_header *)msginfo->msg;
        gpadlmsg->header.msgtype = CHANNELMSG_GPADL_HEADER;
@@ -448,11 +441,6 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
        }
        wait_for_completion(&msginfo->waitevent);
 
-       if (channel->rescind) {
-               ret = -ENODEV;
-               goto cleanup;
-       }
-
        /* At this point, we received the gpadl created msg */
        *gpadl_handle = gpadlmsg->gpadl;
 
@@ -486,7 +474,6 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)
                return -ENOMEM;
 
        init_completion(&info->waitevent);
-       info->waiting_channel = channel;
 
        msg = (struct vmbus_channel_gpadl_teardown *)info->msg;
 
@@ -506,11 +493,6 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)
 
        wait_for_completion(&info->waitevent);
 
-       if (channel->rescind) {
-               ret = -ENODEV;
-               goto post_msg_err;
-       }
-
 post_msg_err:
        spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
        list_del(&info->msglistentry);
index 689cbbcc30a8ec0216130ebc3ac970a7fb22a31e..26b419203f16a6eee9f34f22659a3d09230c2aa0 100644 (file)
@@ -147,29 +147,6 @@ static const struct {
        { HV_RDV_GUID   },
 };
 
-/*
- * The rescinded channel may be blocked waiting for a response from the host;
- * take care of that.
- */
-static void vmbus_rescind_cleanup(struct vmbus_channel *channel)
-{
-       struct vmbus_channel_msginfo *msginfo;
-       unsigned long flags;
-
-
-       spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
-
-       list_for_each_entry(msginfo, &vmbus_connection.chn_msg_list,
-                               msglistentry) {
-
-               if (msginfo->waiting_channel == channel) {
-                       complete(&msginfo->waitevent);
-                       break;
-               }
-       }
-       spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
-}
-
 static bool is_unsupported_vmbus_devs(const uuid_le *guid)
 {
        int i;
@@ -846,8 +823,6 @@ static void vmbus_onoffer_rescind(struct vmbus_channel_message_header *hdr)
        channel->rescind = true;
        spin_unlock_irqrestore(&channel->lock, flags);
 
-       vmbus_rescind_cleanup(channel);
-
        if (channel->device_obj) {
                if (channel->chn_rescind_callback) {
                        channel->chn_rescind_callback(channel);
index 62679a93e01e53a94c55dd8b8fe656b0d321008c..183efde54269e18c5d4d1eda7dc448717fe85800 100644 (file)
@@ -641,7 +641,6 @@ struct vmbus_channel_msginfo {
 
        /* Synchronize the request/response if needed */
        struct completion  waitevent;
-       struct vmbus_channel *waiting_channel;
        union {
                struct vmbus_channel_version_supported version_supported;
                struct vmbus_channel_open_result open_result;