From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z09JB-0003WS-4z for qemu-devel@nongnu.org; Wed, 03 Jun 2015 10:06:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z09J5-0003wb-Az for qemu-devel@nongnu.org; Wed, 03 Jun 2015 10:06:17 -0400 Received: from mail-wg0-x236.google.com ([2a00:1450:400c:c00::236]:32794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z09J5-0003wW-4K for qemu-devel@nongnu.org; Wed, 03 Jun 2015 10:06:11 -0400 Received: by wgez8 with SMTP id z8so10248743wge.0 for ; Wed, 03 Jun 2015 07:06:10 -0700 (PDT) Date: Wed, 3 Jun 2015 15:06:07 +0100 From: Stefan Hajnoczi Message-ID: <20150603140607.GC20862@stefanha-thinkpad.redhat.com> References: <8145574.73ivEs6Dzv@o3-3> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Izn7cH1Com+I3R9J" Content-Disposition: inline In-Reply-To: <8145574.73ivEs6Dzv@o3-3> Subject: Re: [Qemu-devel] Strange problems with lseek in qemu-img map List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Weber Cc: qemu-devel@nongnu.org --Izn7cH1Com+I3R9J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 02, 2015 at 02:54:17PM +0200, David Weber wrote: > Testcase: > # qemu-img create test 500G > # time qemu-img map test >=20 > Systems: > O3-3: Kubuntu 15.04 Workstation with stock-kernel 3.19.0-18-generic and s= tock=20 > qemu 2.2.0 > Dinah: Ubuntu Server 15.04 with stock-kernel 3.19.0-18-generic and stock = qemu=20 > 2.2.0 These systems have the same kernel but for some reason O3-3 completes quickly while Dinah takes a long time in lseek(fd, offset, SEEK_DATA). It looks like the file is empty (the syscall keeps returning ENXIO because there are no allocated blocks in the file where qemu-img probes). > Result on O3-3: > root@o3-3:~# qemu-img create test 500G > Formatting 'test', fmt=3Draw size=3D536870912000=20 > root@o3-3:~# time qemu-img map test > Offset Length Mapped to File >=20 > real 0m0.049s > user 0m0.048s > sys 0m0.000s >=20 > Result on dinah: > root@dinah:~# qemu-img create test 500G > Formatting 'test', fmt=3Draw size=3D536870912000=20 > root@dinah:~# time qemu-img map test > Offset Length Mapped to File > ^C >=20 > real 0m41.862s > user 0m0.004s > sys 0m0.068s > (Stopped with ^C) >=20 > Strace on O3-3: > https://gist.github.com/anonymous/f221035e9176f7c71c74 >=20 > Strace on dinah: > https://gist.github.com/anonymous/40b42888a65478c90b32 >=20 > A git bisect between 1.7 and master revealed=20 > 7c15903789953ead14a417882657d52dc0c19a24 "block/raw-posix: use seek_hole = ahead=20 > of fiemap" as bad but this is not the real problem. > I also tried to switch from btrfs to ext4 but it didn't change anything. >=20 > At this point, I was pretty sure that was just stupit and missing somethi= ng=20 > trivial. > I then startet a fedora 22 live system and I saw the same problem. It hap= pens=20 > on both the ramdisk and a ext4 filesystem. "it" =3D=3D qemu-img map hangs or takes a very long time? Can you post a shell script that reproduces this with a ramdisk? That seems like the easiest way to get people debugging it. Stefan --Izn7cH1Com+I3R9J Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVbwnPAAoJEJykq7OBq3PICS4IAJcvqQlO9dWE61pf+bgBfhmU uNVaZLeTiQIC1KxzzbZuZ9Qk1Bh52VBF0bzIAkGnAL1hjXgr6D0oxBZNtG0HlvPK bIQAr30x2BgGZUF3iNpW64Bw6oFICxGofCzizQplI/m0STekcb+cK7ZTmr9MbiCE vnr2BkGPPR0i0dzNEXUjnA4slG9OoLtJ9Iq82NVIJfqLGlt8kT3JhFP6k3UoDz3A ksYa8QVkbf8bmLZpq4kjNrk/Q8pCxDMlUIkXvCRPbh5IHtRgcRmOVYigxzCE5Kge dF9F+A1zCA0Ypuugbdlr0FOt5E5oxcxJdR9ECSjDICowsijn0E1zXMijmOkd24U= =QOeX -----END PGP SIGNATURE----- --Izn7cH1Com+I3R9J--