Oversize writes were attempting to write the whole length of the
write each time, rather than BUFSIZ chunks. This could cause
disk corruption.

Available from git.alex.org.uk as usual.
-- 
Alex Bligh

Signed-off-by: Alex Bligh <[email protected]>
---
 nbd-server.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/nbd-server.c b/nbd-server.c
index 695deef..d57120b 100644
--- 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);
-- 
1.7.4.1


------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Nbd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nbd-general

Reply via email to