summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-13 10:23:36 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-13 10:23:36 -0800
commit4c257ec37bc365614933c7f0a7fe9b0688dfd1e7 (patch)
tree37df4c3e0e963df9b87729c19f7c337e2f53008e /tools
parent39272dde8ffcfd1322209e05f3f8fa4d14f796de (diff)
parented6dc538e5a36a331b6256d54f435c80f6715460 (diff)
downloadlinux-4c257ec37bc365614933c7f0a7fe9b0688dfd1e7.tar.bz2
Merge tag 'char-misc-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc updates from Greg KH: "Here's the big set of char/misc patches for 4.5-rc1. Nothing major, lots of different driver subsystem updates, full details in the shortlog. All of these have been in linux-next for a while" * tag 'char-misc-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (71 commits) mei: fix fasync return value on error parport: avoid assignment in if parport: remove unneeded space parport: change style of NULL comparison parport: remove unnecessary out of memory message parport: remove braces parport: quoted strings should not be split parport: code indent should use tabs parport: fix coding style parport: EXPORT_SYMBOL should follow function parport: remove trailing white space parport: fix a trivial typo coresight: Fix a typo in Kconfig coresight: checking for NULL string in coresight_name_match() Drivers: hv: vmbus: Treat Fibre Channel devices as performance critical Drivers: hv: utils: fix hvt_op_poll() return value on transport destroy Drivers: hv: vmbus: fix the building warning with hyperv-keyboard extcon: add Maxim MAX3355 driver Drivers: hv: ring_buffer: eliminate hv_ringbuffer_peek() Drivers: hv: remove code duplication between vmbus_recvpacket()/vmbus_recvpacket_raw() ...
Diffstat (limited to 'tools')
-rw-r--r--tools/hv/hv_fcopy_daemon.c24
-rw-r--r--tools/hv/hv_vss_daemon.c2
2 files changed, 20 insertions, 6 deletions
diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
index 5480e4e424eb..fdc9ca4c0356 100644
--- 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)
@@ -165,7 +179,7 @@ int main(int argc, char *argv[])
}
openlog("HV_FCOPY", 0, LOG_USER);
- syslog(LOG_INFO, "HV_FCOPY starting; pid is:%d", getpid());
+ syslog(LOG_INFO, "starting; pid is:%d", getpid());
fcopy_fd = open("/dev/vmbus/hv_fcopy", O_RDWR);
@@ -201,7 +215,7 @@ int main(int argc, char *argv[])
}
kernel_modver = *(__u32 *)buffer;
in_handshake = 0;
- syslog(LOG_INFO, "HV_FCOPY: kernel module version: %d",
+ syslog(LOG_INFO, "kernel module version: %d",
kernel_modver);
continue;
}
diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
index 96234b638249..5d51d6ff08e6 100644
--- a/tools/hv/hv_vss_daemon.c
+++ b/tools/hv/hv_vss_daemon.c
@@ -254,7 +254,7 @@ int main(int argc, char *argv[])
syslog(LOG_ERR, "Illegal op:%d\n", op);
}
vss_msg->error = error;
- len = write(vss_fd, &error, sizeof(struct hv_vss_msg));
+ len = write(vss_fd, vss_msg, sizeof(struct hv_vss_msg));
if (len != sizeof(struct hv_vss_msg)) {
syslog(LOG_ERR, "write failed; error: %d %s", errno,
strerror(errno));