projects
/
nbd.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
946a2a6
)
Fix handling of oversize writes
author
Alex Bligh <alex@alex.org.uk>
Sat, 28 May 2011 18:29:20 +0000
(19:29 +0100)
committer
Alex Bligh <alex@alex.org.uk>
Sat, 28 May 2011 18:29:20 +0000
(19:29 +0100)
Oversize writes were attempting to write the whole length of the
write each time, rather than BUFSIZ chunks. This could cause
disk corruption.
nbd-server.c
patch
|
blob
|
history
diff --git
a/nbd-server.c
b/nbd-server.c
index
695deef
..
d57120b
100644
(file)
--- a/
nbd-server.c
+++ b/
nbd-server.c
@@
-1568,7
+1568,7
@@
int mainloop(CLIENT *client) {
consume(client->net, buf, len-currlen, BUFSIZE);
continue;
}
- if (expwrite(request.from, buf, len, client,
+ if (expwrite(request.from, buf, currlen, client,
request.type & NBD_CMD_FLAG_FUA)) {
DEBUG("Write failed: %m" );
ERROR(client, reply, errno);