]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block/mirror: check backing in bdrv_mirror_top_flush
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Fri, 29 Sep 2017 15:22:55 +0000 (18:22 +0300)
committerMax Reitz <mreitz@redhat.com>
Fri, 6 Oct 2017 14:30:48 +0000 (16:30 +0200)
Backing may be zero after failed bdrv_append in mirror_start_job,
which leads to SIGSEGV.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20170929152255.5431-1-vsementsov@virtuozzo.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/mirror.c

index 3b6f0c577221bb05205561d94ec5512b805de776..153758ca9fafc73dc899a211347bbfc12bd9dffd 100644 (file)
@@ -1041,6 +1041,10 @@ static int coroutine_fn bdrv_mirror_top_pwritev(BlockDriverState *bs,
 
 static int coroutine_fn bdrv_mirror_top_flush(BlockDriverState *bs)
 {
+    if (bs->backing == NULL) {
+        /* we can be here after failed bdrv_append in mirror_start_job */
+        return 0;
+    }
     return bdrv_co_flush(bs->backing->bs);
 }