1
0
Fork 0
alistair23-linux/drivers/hv
Olaf Hering 549e658a09 Drivers: hv: fcopy: restore correct transfer length
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>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-22 10:29:54 +02:00
..
Kconfig x86/hyper-v: Use hypercall for remote TLB flush 2017-08-10 20:16:44 +02:00
Makefile Drivers: hv: util: introduce hv_utils_transport abstraction 2015-05-24 12:17:41 -07:00
channel.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-09-06 14:45:08 -07:00
channel_mgmt.c vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister() 2017-09-22 10:29:54 +02:00
connection.c hyper-v: Globalize vp_index 2017-08-10 16:50:23 +02:00
hv.c hyper-v: Globalize vp_index 2017-08-10 16:50:23 +02:00
hv_balloon.c Drivers: hv: balloon: Initialize last_post_time on startup 2017-08-16 09:14:43 -07:00
hv_fcopy.c Drivers: hv: fcopy: restore correct transfer length 2017-09-22 10:29:54 +02:00
hv_kvp.c Drivers: hv: kvp: Use MAX_ADAPTER_ID_SIZE for translating adapter id 2017-08-16 09:14:43 -07:00
hv_snapshot.c Merge 4.11-rc4 into char-misc-next 2017-03-27 09:13:04 +02:00
hv_util.c hv_utils: fix TimeSync work on pre-TimeSync-v4 hosts 2017-05-25 15:42:42 +02:00
hv_utils_transport.c Drivers: hv: util: move waiting for release to hv_utils_transport itself 2017-03-16 16:42:00 +09:00
hv_utils_transport.h Drivers: hv: util: move waiting for release to hv_utils_transport itself 2017-03-16 16:42:00 +09:00
hyperv_vmbus.h hyper-v: Globalize vp_index 2017-08-10 16:50:23 +02:00
ring_buffer.c vmbus: add prefetch to ring buffer iterator 2017-07-17 17:16:05 +02:00
vmbus_drv.c Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-09-07 09:25:15 -07:00