Home Home > GIT Browse
diff options
authorOlaf Hering <ohering@suse.de>2017-10-20 12:20:33 +0200
committerOlaf Hering <ohering@suse.de>2017-10-20 12:23:29 +0200
commit2589468cc816183522737901d9409431da3af7ad (patch)
parent5ba079b582036f115765a7a0b1f8e4c7efee2df3 (diff)
Drivers: hv: fcopy: restore correct transfer length
2 files changed, 53 insertions, 0 deletions
diff --git a/patches.suse/msft-hv-1468-Drivers-hv-fcopy-restore-correct-transfer-length.patch b/patches.suse/msft-hv-1468-Drivers-hv-fcopy-restore-correct-transfer-length.patch
new file mode 100644
index 0000000000..37be9e5ce0
--- /dev/null
+++ b/patches.suse/msft-hv-1468-Drivers-hv-fcopy-restore-correct-transfer-length.patch
@@ -0,0 +1,52 @@
+From: Olaf Hering <olaf@aepfle.de>
+Date: Thu, 21 Sep 2017 23:41:48 -0700
+Patch-mainline: v4.14-rc4
+Subject: Drivers: hv: fcopy: restore correct transfer length
+Git-commit: 549e658a0919e355a2b2144dc380b3729bef7f3e
+References: fate#323887
+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>
+Acked-by: Olaf Hering <ohering@suse.de>
+ drivers/hv/hv_fcopy.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c
+--- a/drivers/hv/hv_fcopy.c
++++ b/drivers/hv/hv_fcopy.c
+@@ -170,6 +170,10 @@ static void fcopy_send_data(struct work_struct *dummy)
+ out_src = smsg_out;
+ break;
++ case WRITE_TO_FILE:
++ out_src = fcopy_transaction.fcopy_msg;
++ out_len = sizeof(struct hv_do_fcopy);
++ break;
+ default:
+ out_src = fcopy_transaction.fcopy_msg;
+ out_len = fcopy_transaction.recv_len;
diff --git a/series.conf b/series.conf
index c17cc23077..a89e63a855 100644
--- a/series.conf
+++ b/series.conf
@@ -1715,6 +1715,7 @@
+ patches.suse/msft-hv-1468-Drivers-hv-fcopy-restore-correct-transfer-length.patch