diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-13 13:23:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-13 13:23:36 -0500 |
commit | 4c257ec37bc365614933c7f0a7fe9b0688dfd1e7 (patch) | |
tree | 37df4c3e0e963df9b87729c19f7c337e2f53008e /tools | |
parent | 39272dde8ffcfd1322209e05f3f8fa4d14f796de (diff) | |
parent | ed6dc538e5a36a331b6256d54f435c80f6715460 (diff) |
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.c | 24 | ||||
-rw-r--r-- | tools/hv/hv_vss_daemon.c | 2 |
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 @@ | |||
37 | 37 | ||
38 | static int target_fd; | 38 | static int target_fd; |
39 | static char target_fname[W_MAX_PATH]; | 39 | static char target_fname[W_MAX_PATH]; |
40 | static unsigned long long filesize; | ||
40 | 41 | ||
41 | static int hv_start_fcopy(struct hv_start_fcopy *smsg) | 42 | static int hv_start_fcopy(struct hv_start_fcopy *smsg) |
42 | { | 43 | { |
43 | int error = HV_E_FAIL; | 44 | int error = HV_E_FAIL; |
44 | char *q, *p; | 45 | char *q, *p; |
45 | 46 | ||
47 | filesize = 0; | ||
46 | p = (char *)smsg->path_name; | 48 | p = (char *)smsg->path_name; |
47 | snprintf(target_fname, sizeof(target_fname), "%s/%s", | 49 | snprintf(target_fname, sizeof(target_fname), "%s/%s", |
48 | (char *)smsg->path_name, (char *)smsg->file_name); | 50 | (char *)smsg->path_name, (char *)smsg->file_name); |
@@ -98,14 +100,26 @@ done: | |||
98 | static int hv_copy_data(struct hv_do_fcopy *cpmsg) | 100 | static int hv_copy_data(struct hv_do_fcopy *cpmsg) |
99 | { | 101 | { |
100 | ssize_t bytes_written; | 102 | ssize_t bytes_written; |
103 | int ret = 0; | ||
101 | 104 | ||
102 | bytes_written = pwrite(target_fd, cpmsg->data, cpmsg->size, | 105 | bytes_written = pwrite(target_fd, cpmsg->data, cpmsg->size, |
103 | cpmsg->offset); | 106 | cpmsg->offset); |
104 | 107 | ||
105 | if (bytes_written != cpmsg->size) | 108 | filesize += cpmsg->size; |
106 | return HV_E_FAIL; | 109 | if (bytes_written != cpmsg->size) { |
110 | switch (errno) { | ||
111 | case ENOSPC: | ||
112 | ret = HV_ERROR_DISK_FULL; | ||
113 | break; | ||
114 | default: | ||
115 | ret = HV_E_FAIL; | ||
116 | break; | ||
117 | } | ||
118 | syslog(LOG_ERR, "pwrite failed to write %llu bytes: %ld (%s)", | ||
119 | filesize, (long)bytes_written, strerror(errno)); | ||
120 | } | ||
107 | 121 | ||
108 | return 0; | 122 | return ret; |
109 | } | 123 | } |
110 | 124 | ||
111 | static int hv_copy_finished(void) | 125 | static int hv_copy_finished(void) |
@@ -165,7 +179,7 @@ int main(int argc, char *argv[]) | |||
165 | } | 179 | } |
166 | 180 | ||
167 | openlog("HV_FCOPY", 0, LOG_USER); | 181 | openlog("HV_FCOPY", 0, LOG_USER); |
168 | syslog(LOG_INFO, "HV_FCOPY starting; pid is:%d", getpid()); | 182 | syslog(LOG_INFO, "starting; pid is:%d", getpid()); |
169 | 183 | ||
170 | fcopy_fd = open("/dev/vmbus/hv_fcopy", O_RDWR); | 184 | fcopy_fd = open("/dev/vmbus/hv_fcopy", O_RDWR); |
171 | 185 | ||
@@ -201,7 +215,7 @@ int main(int argc, char *argv[]) | |||
201 | } | 215 | } |
202 | kernel_modver = *(__u32 *)buffer; | 216 | kernel_modver = *(__u32 *)buffer; |
203 | in_handshake = 0; | 217 | in_handshake = 0; |
204 | syslog(LOG_INFO, "HV_FCOPY: kernel module version: %d", | 218 | syslog(LOG_INFO, "kernel module version: %d", |
205 | kernel_modver); | 219 | kernel_modver); |
206 | continue; | 220 | continue; |
207 | } | 221 | } |
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[]) | |||
254 | syslog(LOG_ERR, "Illegal op:%d\n", op); | 254 | syslog(LOG_ERR, "Illegal op:%d\n", op); |
255 | } | 255 | } |
256 | vss_msg->error = error; | 256 | vss_msg->error = error; |
257 | len = write(vss_fd, &error, sizeof(struct hv_vss_msg)); | 257 | len = write(vss_fd, vss_msg, sizeof(struct hv_vss_msg)); |
258 | if (len != sizeof(struct hv_vss_msg)) { | 258 | if (len != sizeof(struct hv_vss_msg)) { |
259 | syslog(LOG_ERR, "write failed; error: %d %s", errno, | 259 | syslog(LOG_ERR, "write failed; error: %d %s", errno, |
260 | strerror(errno)); | 260 | strerror(errno)); |