OSDN Git Service

mirror: Release the dirty bitmap if mirror_start_job() fails
authorAlberto Garcia <berto@igalia.com>
Thu, 22 Nov 2018 15:00:26 +0000 (17:00 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 1 Feb 2019 12:46:44 +0000 (13:46 +0100)
At the moment I don't see how to make this function fail after the
dirty bitmap has been created, but if that was possible then we would
hit the assert(QLIST_EMPTY(&bs->dirty_bitmaps)) in bdrv_close().

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/mirror.c

index 24ede6f..4cf1c08 100644 (file)
@@ -1649,6 +1649,9 @@ fail:
         g_free(s->replaces);
         blk_unref(s->target);
         bs_opaque->job = NULL;
+        if (s->dirty_bitmap) {
+            bdrv_release_dirty_bitmap(bs, s->dirty_bitmap);
+        }
         job_early_fail(&s->common.job);
     }