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