From: Alex Bligh Date: Sun, 22 May 2011 17:50:49 +0000 (+0100) Subject: nbd: Fix using zero offset and length for REQ_FLUSH properly X-Git-Url: http://git.alex.org.uk nbd: Fix using zero offset and length for REQ_FLUSH properly --- diff --git a/nbd.c b/nbd.c index 37949be..f665f54 100644 --- a/nbd.c +++ b/nbd.c @@ -248,7 +248,7 @@ static int nbd_send_req(struct nbd_device *lo, struct request *req) (( (req->cmd_flags & REQ_FUA) && (lo->flags & NBD_FLAG_SEND_FUA)) ? NBD_CMD_FLAG_FUA : 0)); /* Send from & len as zero on FLUSH - other values reserved per protocol */ - if (request.type == NBD_CMD_FLUSH) { + if (nbd_cmd(req) == NBD_CMD_FLUSH) { request.from = 0; request.len = 0; } else {