qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] nbd/server: Fix dirty bitmap logic regression
@ 2018-06-22 15:35 Eric Blake
  0 siblings, 0 replies; only message in thread
From: Eric Blake @ 2018-06-22 15:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Paolo Bonzini, open list:Network Block Dev...

In my hurry to fix a build failure, I introduced a logic bug.
The assertion conditional is backwards, meaning that qemu will
now abort instead of reporting dirty bitmap status.

The bug can only be tickled by an NBD client using an exported
dirty bitmap (which is still an experimental QMP command), so
it's not the end of the world for supported usage (and neither
'make check' nor qemu-iotests fails); but it also shows that we
really want qemu-io support for reading dirty bitmaps if only
so that I can add iotests coverage to prevent future
brown-bag-of-shame events like this one.

Fixes: 45eb6fb6
Signed-off-by: Eric Blake <eblake@redhat.com>
---

No need to rush this one in to mainline, as CI tools are not
detecting the failure; I'll just queue this through my NBD tree
for the next pull request sometime before rc0.

 nbd/server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nbd/server.c b/nbd/server.c
index 50ac8bfafc6..e52b76bd1a4 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -1977,7 +1977,7 @@ static unsigned int bitmap_to_extents(BdrvDirtyBitmap *bitmap, uint64_t offset,

     bdrv_dirty_bitmap_unlock(bitmap);

-    assert(offset > end);
+    assert(offset < end);
     *length = end - offset;
     return i;
 }
-- 
2.14.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-06-22 15:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-22 15:35 [Qemu-devel] [PATCH] nbd/server: Fix dirty bitmap logic regression Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).