block/mirror: check backing in bdrv_mirror_top_flush
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>
This commit is contained in:
parent
163bc39d2c
commit
ce960aa906
|
@ -1041,6 +1041,10 @@ static int coroutine_fn bdrv_mirror_top_pwritev(BlockDriverState *bs,
|
||||||
|
|
||||||
static int coroutine_fn bdrv_mirror_top_flush(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);
|
return bdrv_co_flush(bs->backing->bs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue