* Patch "[PATCH 036/135] tools: hv: report ENOSPC errors in hv_fcopy_daemon" has been added to the 4.4-stable tree
@ 2016-09-09 13:38 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-09-09 13:38 UTC (permalink / raw)
To: olaf, alexander.levin, gregkh, kys; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
[PATCH 036/135] tools: hv: report ENOSPC errors in hv_fcopy_daemon
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
0036-tools-hv-report-ENOSPC-errors-in-hv_fcopy_daemon.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 4c3d90dbac2951d370a2bbb2673191cd526da3ab Mon Sep 17 00:00:00 2001
From: Olaf Hering <olaf@aepfle.de>
Date: Mon, 14 Dec 2015 16:01:34 -0800
Subject: [PATCH 036/135] tools: hv: report ENOSPC errors in hv_fcopy_daemon
[ Upstream commit b4ed5d1682c6613988c2eb1de55df5ac9988afcc ]
Currently some "Unspecified error 0x80004005" is reported on the Windows
side if something fails. Handle the ENOSPC case and return
ERROR_DISK_FULL, which allows at least Copy-VMFile to report a meaning
full error.
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: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/uapi/linux/hyperv.h | 1 +
tools/hv/hv_fcopy_daemon.c | 20 +++++++++++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
--- a/include/uapi/linux/hyperv.h
+++ b/include/uapi/linux/hyperv.h
@@ -313,6 +313,7 @@ enum hv_kvp_exchg_pool {
#define HV_INVALIDARG 0x80070057
#define HV_GUID_NOTFOUND 0x80041002
#define HV_ERROR_ALREADY_EXISTS 0x80070050
+#define HV_ERROR_DISK_FULL 0x80070070
#define ADDR_FAMILY_NONE 0x00
#define ADDR_FAMILY_IPV4 0x01
--- a/tools/hv/hv_fcopy_daemon.c
+++ b/tools/hv/hv_fcopy_daemon.c
@@ -37,12 +37,14 @@
static int target_fd;
static char target_fname[W_MAX_PATH];
+static unsigned long long filesize;
static int hv_start_fcopy(struct hv_start_fcopy *smsg)
{
int error = HV_E_FAIL;
char *q, *p;
+ filesize = 0;
p = (char *)smsg->path_name;
snprintf(target_fname, sizeof(target_fname), "%s/%s",
(char *)smsg->path_name, (char *)smsg->file_name);
@@ -98,14 +100,26 @@ done:
static int hv_copy_data(struct hv_do_fcopy *cpmsg)
{
ssize_t bytes_written;
+ int ret = 0;
bytes_written = pwrite(target_fd, cpmsg->data, cpmsg->size,
cpmsg->offset);
- if (bytes_written != cpmsg->size)
- return HV_E_FAIL;
+ filesize += cpmsg->size;
+ if (bytes_written != cpmsg->size) {
+ switch (errno) {
+ case ENOSPC:
+ ret = HV_ERROR_DISK_FULL;
+ break;
+ default:
+ ret = HV_E_FAIL;
+ break;
+ }
+ syslog(LOG_ERR, "pwrite failed to write %llu bytes: %ld (%s)",
+ filesize, (long)bytes_written, strerror(errno));
+ }
- return 0;
+ return ret;
}
static int hv_copy_finished(void)
Patches currently in stable-queue which might be from olaf@aepfle.de are
queue-4.4/0036-tools-hv-report-ENOSPC-errors-in-hv_fcopy_daemon.patch
queue-4.4/0035-Drivers-hv-utils-run-polling-callback-always-in-inte.patch
queue-4.4/0037-Drivers-hv-util-catch-allocation-errors.patch
queue-4.4/0039-Drivers-hv-vss-run-only-on-supported-host-versions.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-09-09 13:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-09 13:38 Patch "[PATCH 036/135] tools: hv: report ENOSPC errors in hv_fcopy_daemon" has been added to the 4.4-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).