Received: from eggs.gnu.org ([2001:4830:134:3::10]:55512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cACXA-0003F7-AT for qemu-devel@nongnu.org; Fri, 25 Nov 2016 04:11:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cACX6-0004oe-EP for qemu-devel@nongnu.org; Fri, 25 Nov 2016 04:11:04 -0500 Received: from indium.canonical.com ([91.189.90.7]:48770) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cACX6-0004nM-61 for qemu-devel@nongnu.org; Fri, 25 Nov 2016 04:11:00 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1cACX5-0002Sq-1q for ; Fri, 25 Nov 2016 09:10:59 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id CD76B2E80AF for ; Fri, 25 Nov 2016 09:10:58 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Fri, 25 Nov 2016 09:03:23 -0000 From: flumm Reply-To: Bug 1644754 <1644754@bugs.launchpad.net> Sender: bounces@canonical.com Message-Id: <20161125090323.28092.26978.malonedeb@soybean.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1644754] [NEW] gluster partial reads refusal conflicts with qcow2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Public bug reported: there is an inconsistency in how qemu creates qcow2 files, which causes an error in the gluster (and possibly other block drivers) the problem is that the gluster backend expects the filesize to be 512 byte aligned, which is not the case anymore since 2.7.0 when using the file backend for qcow2 files with a backing file the error is then Could not open 'gluster://gluster01/gv0/bar2.qcow2': Could not read L1 tabl= e: Input/output error steps to reproduce: * create a.qcow2 * create b.qcow2 with a.qcow2 as base via filesystem (without gluster) b.qcow2 filesize is not a multiple of 512 bytes * move both files to a gluster share * access to b.qcow2 via gluster block driver fails example: have a gluster server at 'gluster01' with a volume 'gv0' (gluster versions tested: 3.7.15,3.8.5,3.8.5) root@pc:~# mount -t glusterfs gluster01:/gv0 /mnt/gluster root@pc:~# qemu-img create -f qcow2 gluster://gluster01/gv0/foo.qcow2 100M Formatting 'gluster://gluster01/gv0/foo.qcow2', fmt=3Dqcow2 size=3D10485760= 0 encryption=3Doff cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits= =3D16 root@pc:~# qemu-img info /mnt/gluster/foo.qcow2 = image: /mnt/gluster/foo.qcow2 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 193K cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false root@pc:~# qemu-img info gluster://gluster01/gv0/foo.qcow2 image: gluster://gluster01/gv0/foo.qcow2 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 193K cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false root@pc:~# qemu-img create -f qcow2 -b foo.qcow2 gluster://gluster01/gv0/ba= r.qcow2 Formatting 'gluster://gluster01/gv0/bar.qcow2', fmt=3Dqcow2 size=3D10485760= 0 backing_file=3Dfoo.qcow2 encryption=3Doff cluster_size=3D65536 lazy_refco= unts=3Doff refcount_bits=3D16 root@pc:~# qemu-img info /mnt/gluster/bar.qcow2 image: /mnt/gluster/bar.qcow2 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 193K cluster_size: 65536 backing file: foo.qcow2 (actual path: /mnt/gluster/foo.qcow2) Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false root@pc:~# qemu-img info gluster://gluster01/gv0/bar.qcow2 image: gluster://gluster01/gv0/bar.qcow2 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 193K cluster_size: 65536 backing file: foo.qcow2 (actual path: gluster://gluster01/gv0/foo.qcow2) Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false root@pc:~# qemu-img create -f qcow2 -b foo.qcow2 /mnt/gluster/bar2.qcow2 Formatting '/mnt/gluster/bar2.qcow2', fmt=3Dqcow2 size=3D104857600 backing_= file=3Dfoo.qcow2 encryption=3Doff cluster_size=3D65536 lazy_refcounts=3Doff= refcount_bits=3D16 root@pc:~# qemu-img info /mnt/gluster/bar2.qcow2 image: /mnt/gluster/bar2.qcow2 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 193K cluster_size: 65536 backing file: foo.qcow2 (actual path: /mnt/gluster/foo.qcow2) Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false root@pc:~# qemu-img info gluster://gluster01/gv0/bar2.qcow2 qemu-img: Could not open 'gluster://gluster01/gv0/bar2.qcow2': Could not re= ad L1 table: Input/output error root@pc:~# ls -l /mnt/gluster/ total 578 -rw-r--r-- 1 root root 196616 Nov 25 09:07 bar2.qcow2 -rw------- 1 root root 197120 Nov 25 09:07 bar.qcow2 -rw------- 1 root root 197120 Nov 25 09:06 foo.qcow2 drwxr-xr-x 6 root root 46 Nov 24 16:51 images here you can see that the file created with directory path is not 512 byte aligned, while the one created through the gluster api is also, when creating a qcow2 with the nfs block driver, the filesize is also a multiple of 512, but reading a non aligned file with nfs works however ** Affects: qemu Importance: Undecided Status: New -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1644754 Title: gluster partial reads refusal conflicts with qcow2 Status in QEMU: New Bug description: there is an inconsistency in how qemu creates qcow2 files, which causes an error in the gluster (and possibly other block drivers) the problem is that the gluster backend expects the filesize to be 512 byte aligned, which is not the case anymore since 2.7.0 when using the file backend for qcow2 files with a backing file the error is then Could not open 'gluster://gluster01/gv0/bar2.qcow2': Could not read L1 ta= ble: Input/output error steps to reproduce: * create a.qcow2 * create b.qcow2 with a.qcow2 as base via filesystem (without gluster) b.qcow2 filesize is not a multiple of 512 bytes * move both files to a gluster share * access to b.qcow2 via gluster block driver fails example: have a gluster server at 'gluster01' with a volume 'gv0' (gluster versions tested: 3.7.15,3.8.5,3.8.5) root@pc:~# mount -t glusterfs gluster01:/gv0 /mnt/gluster root@pc:~# qemu-img create -f qcow2 gluster://gluster01/gv0/foo.qcow2 100M Formatting 'gluster://gluster01/gv0/foo.qcow2', fmt=3Dqcow2 size=3D104857= 600 encryption=3Doff cluster_size=3D65536 lazy_refcounts=3Doff refcount_bit= s=3D16 root@pc:~# qemu-img info /mnt/gluster/foo.qcow2 = image: /mnt/gluster/foo.qcow2 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 193K cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false root@pc:~# qemu-img info gluster://gluster01/gv0/foo.qcow2 image: gluster://gluster01/gv0/foo.qcow2 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 193K cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false root@pc:~# qemu-img create -f qcow2 -b foo.qcow2 gluster://gluster01/gv0/= bar.qcow2 Formatting 'gluster://gluster01/gv0/bar.qcow2', fmt=3Dqcow2 size=3D104857= 600 backing_file=3Dfoo.qcow2 encryption=3Doff cluster_size=3D65536 lazy_ref= counts=3Doff refcount_bits=3D16 root@pc:~# qemu-img info /mnt/gluster/bar.qcow2 image: /mnt/gluster/bar.qcow2 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 193K cluster_size: 65536 backing file: foo.qcow2 (actual path: /mnt/gluster/foo.qcow2) Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false root@pc:~# qemu-img info gluster://gluster01/gv0/bar.qcow2 image: gluster://gluster01/gv0/bar.qcow2 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 193K cluster_size: 65536 backing file: foo.qcow2 (actual path: gluster://gluster01/gv0/foo.qcow2) Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false root@pc:~# qemu-img create -f qcow2 -b foo.qcow2 /mnt/gluster/bar2.qcow2 Formatting '/mnt/gluster/bar2.qcow2', fmt=3Dqcow2 size=3D104857600 backin= g_file=3Dfoo.qcow2 encryption=3Doff cluster_size=3D65536 lazy_refcounts=3Do= ff refcount_bits=3D16 root@pc:~# qemu-img info /mnt/gluster/bar2.qcow2 image: /mnt/gluster/bar2.qcow2 file format: qcow2 virtual size: 100M (104857600 bytes) disk size: 193K cluster_size: 65536 backing file: foo.qcow2 (actual path: /mnt/gluster/foo.qcow2) Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false root@pc:~# qemu-img info gluster://gluster01/gv0/bar2.qcow2 qemu-img: Could not open 'gluster://gluster01/gv0/bar2.qcow2': Could not = read L1 table: Input/output error root@pc:~# ls -l /mnt/gluster/ total 578 -rw-r--r-- 1 root root 196616 Nov 25 09:07 bar2.qcow2 -rw------- 1 root root 197120 Nov 25 09:07 bar.qcow2 -rw------- 1 root root 197120 Nov 25 09:06 foo.qcow2 drwxr-xr-x 6 root root 46 Nov 24 16:51 images here you can see that the file created with directory path is not 512 byte aligned, while the one created through the gluster api is also, when creating a qcow2 with the nfs block driver, the filesize is also a multiple of 512, but reading a non aligned file with nfs works however To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1644754/+subscriptions