Drivers: hv: utils: Invoke the poll function after handshake
authorK. Y. Srinivasan <kys@microsoft.com>
Tue, 15 Dec 2015 00:01:57 +0000 (16:01 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Dec 2015 03:15:05 +0000 (19:15 -0800)
When the handshake with daemon is complete, we should poll the channel since
during the handshake, we will not be processing any messages. This is a
potential bug if the host is waiting for a response from the guest.
I would like to thank Dexuan for pointing this out.

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

index 2a3420c4ca5988c056ab1a294319a66bf022e132..d4ab81bcd51509505beda71c0beac8aa78ddaf8a 100644 (file)
@@ -154,7 +154,7 @@ static int kvp_handle_handshake(struct hv_kvp_msg *msg)
        pr_debug("KVP: userspace daemon ver. %d registered\n",
                 KVP_OP_REGISTER);
        kvp_register(dm_reg_value);
-       kvp_transaction.state = HVUTIL_READY;
+       hv_poll_channel(kvp_transaction.recv_channel, kvp_poll_wrapper);
 
        return 0;
 }
index 81882d4848bdf1f29f1d26e86bd27f49b3ddb206..67def4a831c80461bd50c9ae867b112f12af414a 100644 (file)
@@ -113,7 +113,7 @@ static int vss_handle_handshake(struct hv_vss_msg *vss_msg)
        default:
                return -EINVAL;
        }
-       vss_transaction.state = HVUTIL_READY;
+       hv_poll_channel(vss_transaction.recv_channel, vss_poll_wrapper);
        pr_debug("VSS: userspace daemon ver. %d registered\n", dm_reg_value);
        return 0;
 }