cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
26ba25
From 290b8b6ab5f9a1f747be698e628c646c7c76b972 Mon Sep 17 00:00:00 2001
26ba25
From: John Snow <jsnow@redhat.com>
26ba25
Date: Wed, 10 Oct 2018 18:19:23 +0100
26ba25
Subject: [PATCH 02/49] nbd/server: fix NBD_CMD_CACHE
26ba25
26ba25
RH-Author: John Snow <jsnow@redhat.com>
26ba25
Message-id: <20181010181924.30470-2-jsnow@redhat.com>
26ba25
Patchwork-id: 82576
26ba25
O-Subject: [RHEL8/rhel qemu-kvm PATCH 1/2] nbd/server: fix NBD_CMD_CACHE
26ba25
Bugzilla: 1636142
26ba25
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
26ba25
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
26ba25
RH-Acked-by: Thomas Huth <thuth@redhat.com>
26ba25
26ba25
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
26ba25
26ba25
We should not go to structured-read branch on CACHE command, fix that.
26ba25
26ba25
Bug introduced in bc37b06a5cde24 "nbd/server: introduce NBD_CMD_CACHE"
26ba25
with the whole feature and affects 3.0.0 release.
26ba25
26ba25
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
26ba25
CC: qemu-stable@nongnu.org
26ba25
Message-Id: <20181003144738.70670-1-vsementsov@virtuozzo.com>
26ba25
Reviewed-by: Eric Blake <eblake@redhat.com>
26ba25
[eblake: commit message typo fix]
26ba25
Signed-off-by: Eric Blake <eblake@redhat.com>
26ba25
(cherry picked from commit 2f454defc23e1be78f2a96bad2877ce7829f61b4)
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
26ba25
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
26ba25
---
26ba25
 nbd/server.c | 3 ++-
26ba25
 1 file changed, 2 insertions(+), 1 deletion(-)
26ba25
26ba25
diff --git a/nbd/server.c b/nbd/server.c
26ba25
index ea5fe0e..1ce3f44 100644
26ba25
--- a/nbd/server.c
26ba25
+++ b/nbd/server.c
26ba25
@@ -2135,7 +2135,8 @@ static coroutine_fn int nbd_do_cmd_read(NBDClient *client, NBDRequest *request,
26ba25
     }
26ba25
 
26ba25
     if (client->structured_reply && !(request->flags & NBD_CMD_FLAG_DF) &&
26ba25
-        request->len) {
26ba25
+        request->len && request->type != NBD_CMD_CACHE)
26ba25
+    {
26ba25
         return nbd_co_send_sparse_read(client, request->handle, request->from,
26ba25
                                        data, request->len, errp);
26ba25
     }
26ba25
-- 
26ba25
1.8.3.1
26ba25