On Wed 21 Mar 2018 02:08:23 PM CET, Eric Blake wrote: >> - This scenario is harder to reach: in order to fill a 1-cluster >> refcount table the size of the image needs to be larger than >> (cluster_size³ / refcount_bits) bytes, that's 16TB with the default >> parameters. So although it can be reproduced easily if you reduce >> the cluster size I think it's very infrequent under normal >> conditions. > > Yes, 16TB for default size, but only 2M for the best-case (512-byte > cluster, 64-bit refcount), so still easy to write a test for.
The test case is indeed very easy: qemu-img create -f qcow2 -o cluster_size=512 hd.qcow2 16M qemu-io -c 'write 0 8222208' hd.qcow2 qemu-io -c 'write 8222208 512' hd.qcow2 What I haven't done is debug the problem yet. As I said I don't think this happens often in a real-world scenario, so I wanted to fix the simple (and more common) problem first. Berto
