If you have a capable file system (tmpfs is good, ext4 not so much; run ./check with TEST_DIR pointing to a good location so as not to skip the test), it's actually possible to create a qcow2 file that expands to a sparse 512T image with just over 38M of content. The test is not the world's fastest (qemu crawling through 256M bits of refcount table to find the next cluster to allocate takes several seconds, as does qemu-img check reporting millions of leaked clusters); but it DOES catch the problem that the previous patch just fixed where writing a compressed cluster to a full image ended up overwriting the wrong cluster. Suggested-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
55 lines
2.4 KiB
Plaintext
55 lines
2.4 KiB
Plaintext
QA output created by 220
|
|
== Creating huge file ==
|
|
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=564049465049088
|
|
== Populating refcounts ==
|
|
wrote 2097152/2097152 bytes at offset 4194304
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 8388608
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 10485760
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 12582912
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 14680064
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 16777216
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 18874368
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 20971520
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 23068672
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 25165824
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 27262976
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 29360128
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 31457280
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 33554432
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 35651584
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 2097152/2097152 bytes at offset 37748736
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
== Checking file before ==
|
|
No errors were found on the image.
|
|
image size 39845888
|
|
== Trying to write compressed cluster ==
|
|
write failed: Input/output error
|
|
image size 562949957615616
|
|
== Writing normal cluster ==
|
|
wrote 2097152/2097152 bytes at offset 0
|
|
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
== Checking file after ==
|
|
wrote 1048576/1048576 bytes at offset 5242880
|
|
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
wrote 31457280/31457280 bytes at offset 8388608
|
|
30 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
|
|
8388589 leaked clusters were found on the image.
|
|
This means waste of disk space, but no harm to data.
|
|
*** done
|