summaryrefslogtreecommitdiff
path: root/drivers/hv
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2020-01-26 08:49:41 +0300
committerSasha Levin <sashal@kernel.org>2020-01-27 06:10:10 +0300
commit9fc3c01a1fae669a2ef9f13ee1e1a26e057d79f8 (patch)
treeabfa8d6dacc777830d4c10eafbfd5497460e4402 /drivers/hv
parent3a6fb6c4255c3893ab61e2bd4e9ae01ca6bbcd94 (diff)
downloadlinux-9fc3c01a1fae669a2ef9f13ee1e1a26e057d79f8.tar.xz
Tools: hv: Reopen the devices if read() or write() returns errors
The state machine in the hv_utils driver can run out of order in some corner cases, e.g. if the kvp daemon doesn't call write() fast enough due to some reason, kvp_timeout_func() can run first and move the state to HVUTIL_READY; next, when kvp_on_msg() is called it returns -EINVAL since kvp_transaction.state is smaller than HVUTIL_USERSPACE_REQ; later, the daemon's write() gets an error -EINVAL, and the daemon will exit(). We can reproduce the issue by sending a SIGSTOP signal to the daemon, wait for 1 minute, and send a SIGCONT signal to the daemon: the daemon will exit() quickly. We can fix the issue by forcing a reset of the device (which means the daemon can close() and open() the device again) and doing extra necessary clean-up. Signed-off-by: Dexuan Cui <decui@microsoft.com> Reviewed-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/hv')
0 files changed, 0 insertions, 0 deletions