From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xowpm-00054E-EB for qemu-devel@nongnu.org; Thu, 13 Nov 2014 11:01:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xowpg-0006VT-I6 for qemu-devel@nongnu.org; Thu, 13 Nov 2014 11:01:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xowpg-0006Tv-8z for qemu-devel@nongnu.org; Thu, 13 Nov 2014 11:01:16 -0500 Message-ID: <5464D5C6.9070507@redhat.com> Date: Thu, 13 Nov 2014 09:01:10 -0700 From: Eric Blake MIME-Version: 1.0 References: <1415873823-13844-1-git-send-email-armbru@redhat.com> <1415873823-13844-4-git-send-email-armbru@redhat.com> <20141113130327.GD3933@noname.redhat.com> <5464C59A.4000602@redhat.com> <5464CE42.4000809@redhat.com> <5464D291.4000303@redhat.com> In-Reply-To: <5464D291.4000303@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="O5147Fqv3h32x859GeRaXk811qB4dqSRq" Subject: Re: [Qemu-devel] [PATCH v2 3/4] raw-posix: Fix try_seek_hole()'s handling of SEEK_DATA failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , Markus Armbruster Cc: famz@redhat.com, tony@bakeyournoodle.com, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --O5147Fqv3h32x859GeRaXk811qB4dqSRq Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/13/2014 08:47 AM, Eric Blake wrote: > The two calls are both necessary, in order to learn which extant type > offset belongs to, and to tell where that extant ends; and the behavior= s > are distinguishable (if both lseek() succeed, we have both numbers we > want; if both fail with ENXIO, we know the offset is at or beyond EOF; > and if only SEEK_HOLE fails with ENXIO, we know we have a trailing ^ I meant SEEK_DATA here. > hole); and we can tell at runtime what to do about a trailing hole (if > the return value is offset, we need one more lseek(fd, 0, SEEK_END) to > find EOF; if the return value is larger than offset, we have EOF for > free). You can optimize by calling SEEK_HOLE first (if it fails with > ENXIO, there is no need to try SEEK_DATA); but SEEK_HOLE in isolation i= s > insufficient to give you all the information you need. >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --O5147Fqv3h32x859GeRaXk811qB4dqSRq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUZNXGAAoJEKeha0olJ0NqRFoH/3F28+W0EoiZ5mVHl5obgg1p D+sUogJZMZUxRvrWZxrraOCD5v/KepdvXG3h7RMCrAT2yrX6rTqVaYcHALOaOQYR sQF+G9xa6hxza88L6A9sRrYsT8eSks/VT1VAgbPamvvWwgzcHrGdrbczCVvvnwum P82j6pmo7+dR0+R3hpPRX8D08fNSowzyfGvhoxqe6VpwfSNlU6sKFSW0mIR34B7h xyM+vahIdjAUFv/FrWxHWIm3g3nOU3gEWZfsRhn1QnlRDdlEN4PMIibLqfNwPact /34fXes8Dil02x68zdc+fsM12Bfffw4ZX2elxy4RwunTrdLJS1Fcx1h1bdhgxVI= =ytvD -----END PGP SIGNATURE----- --O5147Fqv3h32x859GeRaXk811qB4dqSRq--