From: kys@exchange.microsoft.com
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com,
vkuznets@redhat.com, jasowang@redhat.com,
leann.ogasawara@canonical.com, marcelo.cerri@canonical.com,
sthemmin@microsoft.com
Cc: "K . Y . Srinivasan" <kys@microsoft.com>
Subject: [PATCH V2 2/4] Drivers: hv: fcopy: restore correct transfer length
Date: Sun, 17 Sep 2017 20:54:17 -0700 [thread overview]
Message-ID: <20170918035419.11062-2-kys@exchange.microsoft.com> (raw)
In-Reply-To: <20170918035419.11062-1-kys@exchange.microsoft.com>
From: Olaf Hering <olaf@aepfle.de>
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: 'commit c7e490fc23eb ("Drivers: hv: fcopy: convert to hv_utils_transport")'
Fixes: 'commit 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>
---
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
index daa75bd41f86..2364281d8593 100644
--- 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;
--
2.14.1
next prev parent reply other threads:[~2017-09-18 3:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 3:49 [PATCH V2 0/4] Drivers: hv: Miscellaneous fixes kys
2017-09-18 3:54 ` [PATCH V2 1/4] vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister() kys
2017-09-18 3:54 ` kys [this message]
2017-09-18 13:59 ` [PATCH V2 2/4] Drivers: hv: fcopy: restore correct transfer length Greg KH
2017-09-18 3:54 ` [PATCH V2 3/4] vmbus: add per-channel sysfs info kys
2017-09-18 13:59 ` Greg KH
2018-10-18 15:19 ` Olaf Hering
2018-10-18 15:32 ` Michael Kelley
2018-10-18 16:41 ` Stephen Hemminger
2018-10-18 16:39 ` Stephen Hemminger
2017-09-18 3:54 ` [PATCH V2 4/4] Drivers: hv: vmbus: Expose per-channel event counters events counters kys
2017-09-18 13:59 ` Greg KH
2017-09-18 13:57 ` [PATCH V2 1/4] vmbus: don't acquire the mutex in vmbus_hvsock_device_unregister() Greg KH
2017-09-18 14:00 ` Greg KH
2017-09-18 14:43 ` KY Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170918035419.11062-2-kys@exchange.microsoft.com \
--to=kys@exchange.microsoft.com \
--cc=apw@canonical.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=jasowang@redhat.com \
--cc=kys@microsoft.com \
--cc=leann.ogasawara@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.cerri@canonical.com \
--cc=olaf@aepfle.de \
--cc=sthemmin@microsoft.com \
--cc=vkuznets@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox