Bug 1226996

Summary: qcow2: Fix minimum L2 cache size
Product: Red Hat Enterprise Linux 7 Reporter: Kevin Wolf <kwolf>
Component: qemu-kvm-rhevAssignee: Hanna Czenczek <hreitz>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: huding, juzhang, virt-maint, xfu, xwei
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.3.0-3.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-04 16:43:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Kevin Wolf 2015-06-01 15:37:36 UTC
The minimum L2 table cache size for qcow2 is incorrectly defined as 1. It needs
to be at least 2 for COW operations on L2 tables to work (this happens with
internal snapshots); otherwise an abort() is triggered.

The problem can be reproduced as follows:

$ qemu-img create -f qcow2 /tmp/test.qcow2 -o cluster_size=1M 64M
Formatting '/tmp/test.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=1048576 lazy_refcounts=off refcount_bits=16
$ qemu-io -c 'write 0 1M' /tmp/test.qcow2
wrote 1048576/1048576 bytes at offset 0
1 MiB, 1 ops; 0.0836 sec (11.952 MiB/sec and 11.9524 ops/sec)
$ qemu-img snapshot -c test /tmp/test.qcow2
$ qemu-io -c 'write 0 1M' /tmp/test.qcow2
Aborted (core dumped)

Comment 1 Miroslav Rezanina 2015-06-19 11:09:13 UTC
Fix included in qemu-kvm-rhev-2.3.0-3.el7

Comment 3 Xiaoqing Wei 2015-07-03 05:42:49 UTC
on qemu-kvm-rhev-2.3.0-7.el7
[root@dhcp-11-50 ~]# qemu-img create -f qcow2 /tmp/test.qcow2 -o cluster_size=1M 64M
Formatting '/tmp/test.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=1048576 lazy_refcounts=off refcount_bits=16
[root@dhcp-11-50 ~]# qemu-io -c 'write 0 1M' /tmp/test.qcow2
wrote 1048576/1048576 bytes at offset 0
1 MiB, 1 ops; 0.1905 sec (5.248 MiB/sec and 5.2480 ops/sec)
[root@dhcp-11-50 ~]# qemu-img snapshot -c test /tmp/test.qcow2
[root@dhcp-11-50 ~]# qemu-io -c 'write 0 1M' /tmp/test.qcow2
wrote 1048576/1048576 bytes at offset 0
1 MiB, 1 ops; 0.2569 sec (3.892 MiB/sec and 3.8915 ops/sec)


 downgrade to qemu-kvm-rhev-2.3.0-2.el7

[root@dhcp-11-50 ~]# qemu-img create -f qcow2 /tmp/test.qcow2 -o cluster_size=1M 64M
Formatting '/tmp/test.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=1048576 lazy_refcounts=off refcount_bits=16
[root@dhcp-11-50 ~]# qemu-io -c 'write 0 1M' /tmp/test.qcow2
wrote 1048576/1048576 bytes at offset 0
1 MiB, 1 ops; 0.3554 sec (2.813 MiB/sec and 2.8131 ops/sec)
[root@dhcp-11-50 ~]# qemu-img snapshot -c test /tmp/test.qcow2
[root@dhcp-11-50 ~]# qemu-io -c 'write 0 1M' /tmp/test.qcow2
Aborted (core dumped)



move to VERIFIED

Comment 5 errata-xmlrpc 2015-12-04 16:43:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2546.html