qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-stable] [PULL 2/5] nbd/server: fix NBD_CMD_CACHE


From: Eric Blake
Subject: [Qemu-stable] [PULL 2/5] nbd/server: fix NBD_CMD_CACHE
Date: Wed, 3 Oct 2018 16:22:08 -0500

From: Vladimir Sementsov-Ogievskiy <address@hidden>

We should not go to structured-read branch on CACHE command, fix that.

Bug introduced in bc37b06a5cde24 "nbd/server: introduce NBD_CMD_CACHE"
with the whole feature and affects 3.0.0 release.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
CC: address@hidden
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: commit message typo fix]
Signed-off-by: Eric Blake <address@hidden>
---
 nbd/server.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nbd/server.c b/nbd/server.c
index 98d0fa25158..4fb247b1166 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -2177,7 +2177,8 @@ static coroutine_fn int nbd_do_cmd_read(NBDClient 
*client, NBDRequest *request,
     }

     if (client->structured_reply && !(request->flags & NBD_CMD_FLAG_DF) &&
-        request->len) {
+        request->len && request->type != NBD_CMD_CACHE)
+    {
         return nbd_co_send_sparse_read(client, request->handle, request->from,
                                        data, request->len, errp);
     }
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]