[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 01/13] qcow: fix a reference leak
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 01/13] qcow: fix a reference leak |
Date: |
Mon, 30 Jul 2018 17:09:46 +0200 |
From: KONRAD Frederic <address@hidden>
Since 42a3e1ab367cdf38cce093de24eb406b99a4ef96 qemu asserts when using the
vvfat driver:
git clone git://qemu.org/qemu.git
cd qemu
./configure --target-list=ppc-softmmu --enable-debug
make -j8
mkdir foo
touch foo/hello
./ppc-softmmu/qemu-system-ppc -M prep --nographic --monitor null \
-hda fat:rw:./foo
"Ctrl-C"
qemu-system-ppc: block.c:3368: bdrv_close_all: Assertion \
`((&all_bdrv_states)->tqh_first == ((void *)0))' failed.
This is because we reference bs twice in qcow_co_create(..) one time in
bdrv_open_blockdev_ref(..) and in blk_insert_bs(..) but we unref it only once
in blk_unref which leads to the reference leak.
Note that I didn't tested much QCOW after this change as I don't use it much.
Signed-off-by: KONRAD Frederic <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/qcow.c b/block/qcow.c
index 102d058d1c..385d935258 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -938,6 +938,7 @@ static int coroutine_fn
qcow_co_create(BlockdevCreateOptions *opts,
ret = 0;
exit:
blk_unref(qcow_blk);
+ bdrv_unref(bs);
qcrypto_block_free(crypto);
return ret;
}
--
2.13.6
- [Qemu-block] [PULL 00/13] Block layer patches, Kevin Wolf, 2018/07/30
- [Qemu-block] [PULL 02/13] qcow2: A grammar fix in conflicting cache sizing error message, Kevin Wolf, 2018/07/30
- [Qemu-block] [PULL 01/13] qcow: fix a reference leak,
Kevin Wolf <=
- [Qemu-block] [PULL 04/13] docs: Describe using images in writing iotests, Kevin Wolf, 2018/07/30
- [Qemu-block] [PULL 03/13] file-posix: Handle EINTR in preallocation=full write, Kevin Wolf, 2018/07/30
- [Qemu-block] [PULL 05/13] iotests: Don't lock /dev/null in 226, Kevin Wolf, 2018/07/30
- [Qemu-block] [PULL 06/13] Revert "qemu-img: Document copy offloading implications with -S and -c", Kevin Wolf, 2018/07/30
- [Qemu-block] [PULL 07/13] qemu-img: Add -C option for convert with copy offloading, Kevin Wolf, 2018/07/30
- [Qemu-block] [PULL 10/13] file-posix: Fix write_zeroes with unmap on block devices, Kevin Wolf, 2018/07/30
- [Qemu-block] [PULL 08/13] iotests: Add test for 'qemu-img convert -C' compatibility, Kevin Wolf, 2018/07/30
- [Qemu-block] [PULL 11/13] block/qapi: Add 'qdev' field to query-blockstats result, Kevin Wolf, 2018/07/30
- [Qemu-block] [PULL 12/13] block/qapi: Include anonymous BBs in query-blockstats, Kevin Wolf, 2018/07/30
- [Qemu-block] [PULL 09/13] block: Fix documentation for BDRV_REQ_MAY_UNMAP, Kevin Wolf, 2018/07/30