From 5b87524b212d19c85615885d13431440709faf2c Mon Sep 17 00:00:00 2001 From: Alex Bligh Date: Sun, 22 May 2011 18:50:49 +0100 Subject: [PATCH] nbd: Fix using zero offset and length for REQ_FLUSH properly --- nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- 1.7.10.4