android_kernel_oneplus_msm8998/drivers/hv
Olaf Hering c85e9442f9 Drivers: hv: fcopy: restore correct transfer length
commit 549e658a0919e355a2b2144dc380b3729bef7f3e upstream.

Till recently the expected length of bytes read by the
daemon did depend on the context. It was either hv_start_fcopy or
hv_do_fcopy. The daemon had a buffer size of two pages, which was much
larger than needed.

Now the expected length of bytes read by the
daemon changed slightly. For START_FILE_COPY it is still the size of
hv_start_fcopy.  But for WRITE_TO_FILE and the other operations it is as
large as the buffer that arrived via vmbus. In case of WRITE_TO_FILE
that is slightly larger than a struct hv_do_fcopy. Since the buffer in
the daemon was still larger everything was fine.

Currently, the daemon reads only what is actually needed.
The new buffer layout is as large as a struct hv_do_fcopy, for the
WRITE_TO_FILE operation. Since the kernel expects a slightly larger
size, hvt_op_read will return -EINVAL because the daemon will read
slightly less than expected. Address this by restoring the expected
buffer size in case of WRITE_TO_FILE.

Fixes: 'c7e490fc23eb ("Drivers: hv: fcopy: convert to hv_utils_transport")'
Fixes: '3f2baa8a7d2e ("Tools: hv: update buffer handling in hv_fcopy_daemon")'

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-12 11:27:33 +02:00
..
channel.c Drivers: hv: get rid of timeout in vmbus_open() 2017-04-27 09:09:32 +02:00
channel_mgmt.c Drivers: hv: vmbus: avoid scheduling in interrupt context in vmbus_initiate_unload() 2016-09-15 08:27:46 +02:00
connection.c Drivers: hv: vmbus: Reduce the delay between retries in vmbus_post_msg() 2017-04-27 09:09:32 +02:00
hv.c hv: don't reset hv_context.tsc_page on crash 2017-04-27 09:09:34 +02:00
hv_balloon.c Drivers: hv: balloon: account for gaps in hot add regions 2017-04-27 09:09:34 +02:00
hv_fcopy.c Drivers: hv: fcopy: restore correct transfer length 2017-10-12 11:27:33 +02:00
hv_kvp.c Drivers: hv: util: kvp: Fix a rescind processing issue 2017-03-12 06:37:29 +01:00
hv_snapshot.c Drivers: hv: util: Backup: Fix a rescind processing issue 2017-03-12 06:37:29 +01:00
hv_util.c hv: do not lose pending heartbeat vmbus packets 2016-11-10 16:36:34 +01:00
hv_utils_transport.c Drivers: hv: util: catch allocation errors 2016-09-15 08:27:40 +02:00
hv_utils_transport.h Drivers: hv: util: introduce hv_utils_transport abstraction 2015-05-24 12:17:41 -07:00
hyperv_vmbus.h Drivers: hv: avoid vfree() on crash 2017-03-26 12:13:18 +02:00
Kconfig x86: Make Linux guest support optional 2013-03-04 13:14:25 -08:00
Makefile Drivers: hv: util: introduce hv_utils_transport abstraction 2015-05-24 12:17:41 -07:00
ring_buffer.c Drivers: hv_vmbus: Fix signal to host condition 2015-08-05 11:44:29 -07:00
vmbus_drv.c Drivers: hv: avoid vfree() on crash 2017-03-26 12:13:18 +02:00