Blame SOURCES/kvm-nbd-server-Fix-dirty-bitmap-logic-regression.patch

383d26
From 05a40305eb495ff14c9bfcb1aa94c168b54d79ce Mon Sep 17 00:00:00 2001
383d26
From: John Snow <jsnow@redhat.com>
383d26
Date: Wed, 18 Jul 2018 22:55:08 +0200
383d26
Subject: [PATCH 83/89] nbd/server: Fix dirty bitmap logic regression
383d26
383d26
RH-Author: John Snow <jsnow@redhat.com>
383d26
Message-id: <20180718225511.14878-33-jsnow@redhat.com>
383d26
Patchwork-id: 81427
383d26
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 32/35] nbd/server: Fix dirty bitmap logic regression
383d26
Bugzilla: 1207657
383d26
RH-Acked-by: Eric Blake <eblake@redhat.com>
383d26
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
383d26
RH-Acked-by: Fam Zheng <famz@redhat.com>
383d26
383d26
From: Eric Blake <eblake@redhat.com>
383d26
383d26
In my hurry to fix a build failure, I introduced a logic bug.
383d26
The assertion conditional is backwards, meaning that qemu will
383d26
now abort instead of reporting dirty bitmap status.
383d26
383d26
The bug can only be tickled by an NBD client using an exported
383d26
dirty bitmap (which is still an experimental QMP command), so
383d26
it's not the end of the world for supported usage (and neither
383d26
'make check' nor qemu-iotests fails); but it also shows that we
383d26
really want qemu-io support for reading dirty bitmaps if only
383d26
so that I can add iotests coverage to prevent future
383d26
brown-bag-of-shame events like this one.
383d26
383d26
Fixes: 45eb6fb6
383d26
Signed-off-by: Eric Blake <eblake@redhat.com>
383d26
Message-Id: <20180622153509.375130-1-eblake@redhat.com>
383d26
(cherry picked from commit 7606c99a0421be7e9d984766fe239f7791a2fd9c)
383d26
Signed-off-by: John Snow <jsnow@redhat.com>
383d26
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
---
383d26
 nbd/server.c | 2 +-
383d26
 1 file changed, 1 insertion(+), 1 deletion(-)
383d26
383d26
diff --git a/nbd/server.c b/nbd/server.c
383d26
index 50ac8bf..e52b76b 100644
383d26
--- a/nbd/server.c
383d26
+++ b/nbd/server.c
383d26
@@ -1977,7 +1977,7 @@ static unsigned int bitmap_to_extents(BdrvDirtyBitmap *bitmap, uint64_t offset,
383d26
 
383d26
     bdrv_dirty_bitmap_unlock(bitmap);
383d26
 
383d26
-    assert(offset > end);
383d26
+    assert(offset < end);
383d26
     *length = end - offset;
383d26
     return i;
383d26
 }
383d26
-- 
383d26
1.8.3.1
383d26