Fix offset calculation for partial msyncs to go to nearest 4k block

Previously they were always set to zero.
This commit is contained in:
Patrick J Cherry
2018-02-05 23:05:00 +00:00
parent c423900f02
commit 6d6948af09

View File

@@ -481,7 +481,7 @@ void client_reply_to_write( struct client* client, struct nbd_request request )
if (request.flags & CMD_FLAG_FUA)
{
/* multiple of 4K page size */
uint64_t from_rounded = request.from & (!0xfff);
uint64_t from_rounded = request.from & (~0xfff);
uint64_t len_rounded = request.len + (request.from - from_rounded);
debug("Calling msync from=%"PRIu64", len=%"PRIu64"",from_rounded, len_rounded);