[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 50/54] block/mirror: check backing in bdrv_mirror_top
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 50/54] block/mirror: check backing in bdrv_mirror_top_refresh_filename |
Date: |
Fri, 6 Oct 2017 17:54:18 +0200 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Backing may be zero after failed bdrv_attach_child in
bdrv_set_backing_hd, which leads to SIGSEGV.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-id: address@hidden
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
block/mirror.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/block/mirror.c b/block/mirror.c
index 459b80f8f3..3b6f0c5772 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1058,6 +1058,11 @@ static int coroutine_fn
bdrv_mirror_top_pdiscard(BlockDriverState *bs,
static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts)
{
+ if (bs->backing == NULL) {
+ /* we can be here after failed bdrv_attach_child in
+ * bdrv_set_backing_hd */
+ return;
+ }
bdrv_refresh_filename(bs->backing->bs);
pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
bs->backing->bs->filename);
--
2.13.6
- [Qemu-block] [PULL 37/54] commit: Remove overlay_bs, (continued)
- [Qemu-block] [PULL 37/54] commit: Remove overlay_bs, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 39/54] block: Uniform handling of 0-length bdrv_get_block_status(), Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 40/54] iotests: Restore stty settings on completion, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 42/54] block: Perform copy-on-read in loop, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 36/54] qemu-iotests: Test commit block job where top has two parents, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 43/54] iotests: Add test 197 for covering copy-on-read, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 44/54] block: use 1 MB bounce buffers for crypto instead of 16KB, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 46/54] block: fix data type casting for crypto payload offset, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 45/54] crypto: expose encryption sector size in APIs, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 47/54] block: convert crypto driver to bdrv_co_preadv|pwritev, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 50/54] block/mirror: check backing in bdrv_mirror_top_refresh_filename,
Kevin Wolf <=
- [Qemu-block] [PULL 48/54] block: convert qcrypto_block_encrypt|decrypt to take bytes offset, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 49/54] block: support passthrough of BDRV_REQ_FUA in crypto driver, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 53/54] qcow2: truncate the tail of the image file after shrinking the image, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 54/54] block/mirror: check backing in bdrv_mirror_top_flush, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 51/54] iotests: Fix 195 if IMGFMT is part of TEST_DIR, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 52/54] qcow2: fix return error code in qcow2_truncate(), Kevin Wolf, 2017/10/06
- Re: [Qemu-block] [Qemu-devel] [PULL 00/54] Block layer patches, Peter Maydell, 2017/10/06