Under certain circumstances, making the refcount table grow can result in leaking clusters. The first patch fixes at least some of those circumstances (maybe there are more, but these are the ones I am aware of), and the second patch adds a test case.
Max Reitz (2): qcow2: Respect new_block in alloc_refcount_block() iotests: Add tests for refcount table growth block/qcow2-refcount.c | 16 ++++++- tests/qemu-iotests/121 | 102 +++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/121.out | 23 ++++++++++ tests/qemu-iotests/group | 1 + 4 files changed, 140 insertions(+), 2 deletions(-) create mode 100755 tests/qemu-iotests/121 create mode 100644 tests/qemu-iotests/121.out -- 2.1.0