]> git.baikalelectronics.ru Git - kernel.git/commit
Drivers: hv: fcopy: restore correct transfer length
authorOlaf Hering <olaf@aepfle.de>
Fri, 22 Sep 2017 06:41:48 +0000 (23:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Sep 2017 08:29:54 +0000 (10:29 +0200)
commit0f5f8033eab3a2bc937c5643ecddd75eb1b2fe36
tree03e79a4003daa4b7fbfcff8969cd315d05fb4904
parent3b3bcd573e254870fdd55ada4196ed54e2074ce7
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: '1d4302f207f2 ("Drivers: hv: fcopy: convert to hv_utils_transport")'
Fixes: 'f9ddf412cabb ("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>
drivers/hv/hv_fcopy.c