Staging: hv: util: Fix a bug in kvp implementation
authorK. Y. Srinivasan <kys@microsoft.com>
Tue, 4 Oct 2011 21:00:02 +0000 (14:00 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 Oct 2011 00:05:27 +0000 (17:05 -0700)
commit76e5f8135d63eb784ef44438e46e82cf0329e179
tree1159513b1b822081bcd5333745e6b2e96061007c
parent93decf3661bf1c7c05bbc217d4e69222b557512a
Staging: hv: util: Fix a bug in kvp implementation

The host gurantees that there can be only one kvp transaction active
against the guest. So, the transaction active state is needed only to
protect against spurious user level calls. The current code had a race
condition where the guest could prematurely return because the previous
transaction state was not cleared - this state was being cleared after
sending the response to the host and there was a window where the host
could notify the guest of a new transaction before the transaction active
state was properly set.
Also deal with the case when the user mode component
does not respond in a timely fashion correctly.
I would like to thank Long Li <longli@microsoft.com>
for identifying the problem.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Diagnosed-by: Long Li <longli@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/hv_kvp.c