linux/drivers/hv
Olaf Hering c541aaad4a Drivers: hv: fcopy: restore correct transfer length
commit 549e658a09 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: 'c7e490fc23 ("Drivers: hv: fcopy: convert to hv_utils_transport")'
Fixes: '3f2baa8a7d ("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>
History 2017-10-12 11:51:24 +02:00
..
channel.c Drivers: hv: vmbus: Don't leak memory when a channel is rescinded 2017-03-30 09:41:27 +02:00
channel_mgmt.c Drivers: hv: vmbus: Don't leak channel ids 2017-03-30 09:41:27 +02:00
connection.c Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg() 2017-03-12 06:41:47 +01:00
hv.c drivers: hv: Turn off write permission on the hypercall page 2017-03-15 10:02:52 +08:00
hv_balloon.c Drivers: hv: balloon: Use available memory value in pressure report 2016-08-31 13:05:42 +02:00
hv_fcopy.c Drivers: hv: fcopy: restore correct transfer length 2017-10-12 11:51:24 +02:00
hv_kvp.c Drivers: hv: util: kvp: Fix a rescind processing issue 2017-03-12 06:41:49 +01:00
hv_snapshot.c Drivers: hv: util: Backup: Fix a rescind processing issue 2017-03-12 06:41:50 +01:00
hv_util.c hv: do not lose pending heartbeat vmbus packets 2016-10-25 08:52:10 +02:00
hv_utils_transport.c Drivers: hv: utils: fix a race on userspace daemons registration 2016-08-31 13:05:41 +02:00
hv_utils_transport.h Drivers: hv: utils: fix a race on userspace daemons registration 2016-08-31 13:05:41 +02:00
hyperv_vmbus.h Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg() 2017-03-12 06:41:47 +01: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: Prevent sending data on a rescinded channel 2017-03-12 06:41:49 +01:00
vmbus_drv.c vmbus: make sysfs names consistent with PCI 2016-11-01 09:07:13 -06:00