Oversize writes were attempting to write the whole length of the
write each time, rather than BUFSIZ chunks. This could cause
disk corruption.
consume(client->net, buf, len-currlen, BUFSIZE);
continue;
}
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);
request.type & NBD_CMD_FLAG_FUA)) {
DEBUG("Write failed: %m" );
ERROR(client, reply, errno);