nbd: Fix using zero offset and length for REQ_FLUSH properly master
authorAlex Bligh <alex@alex.org.uk>
Sun, 22 May 2011 17:50:49 +0000 (18:50 +0100)
committerAlex Bligh <alex@alex.org.uk>
Sun, 22 May 2011 17:50:49 +0000 (18:50 +0100)
nbd.c

diff --git a/nbd.c b/nbd.c
index 37949be..f665f54 100644 (file)
--- 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 {