From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCajU-0007g3-Qq for qemu-devel@nongnu.org; Thu, 22 Aug 2013 15:39:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCajP-0000TV-Ts for qemu-devel@nongnu.org; Thu, 22 Aug 2013 15:39:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCajP-0000TH-Ls for qemu-devel@nongnu.org; Thu, 22 Aug 2013 15:39:43 -0400 Message-ID: <521668B8.6050203@redhat.com> Date: Thu, 22 Aug 2013 13:38:32 -0600 From: Eric Blake MIME-Version: 1.0 References: <1377163743-25029-1-git-send-email-stefanha@redhat.com> <1377163743-25029-3-git-send-email-stefanha@redhat.com> <52165124.30101@redhat.com> <4C5A7A1D9E0FC7CCAEA83FA1@nimrod.local> In-Reply-To: <4C5A7A1D9E0FC7CCAEA83FA1@nimrod.local> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Qh3l1Q9vS0NBSEF1wiGiwKCbKie7dhWN6" Subject: Re: [Qemu-devel] [PATCH 2/2] osdep: warn if open(O_DIRECT) on fails with EINVAL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: Kevin Wolf , Deepak C Shetty , qemu-devel@nongnu.org, Stefan Hajnoczi , Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Qh3l1Q9vS0NBSEF1wiGiwKCbKie7dhWN6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/22/2013 01:31 PM, Alex Bligh wrote: >=20 >=20 > --On 22 August 2013 11:57:56 -0600 Eric Blake wrote= : >=20 >> # define O_DIRECT 0 >> >> so that the rest of the code can just blindly use open(...,|O_DIRECT) >> (provided, of course, that not having O_DIRECT semantics is not >> fatal...). If that is done, then this #ifdef will always be true... >=20 > I think this is undesirable as the result of opening without O_DIRECT > when you really wanted O_DIRECT could be subtle data corruption due > to unexpected caching. Is an error not more appropriate here than > proceeding regardless? As I said in the surrounding text you snipped: >=20 > On some other projects I've worked with (hello gnulib!), the > compatibility headers do: =2E.. >=20 > But enough of that side diversion - that one #define of O_DIRECT is not= > related to the file you are touching.=20 Qemu doesn't define O_DIRECT to 0 for the mere sake of compilation, and I'm not arguing that it should. I was more making sure that this patch was correct, by reassuring myself the policies that qemu uses for O_DIRECT (and since I demonstrated that other projects have other policies). As to whether other projects may have a bug when using O_DIRECT being 0, it is a problem for those projects to deal with. Besides, O_DIRECT is a non-POSIX extension, so anyone using it already has non-portability issues to think about, regardless of whether the fallback for platforms that lack it is done by always defining to 0 or always using #ifdef guards. Thus, my diversion about other projects using O_DIRECT as 0 is a non-issu= e. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Qh3l1Q9vS0NBSEF1wiGiwKCbKie7dhWN6 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.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSFmi5AAoJEKeha0olJ0Nqy28H/2Lhm8K0MOdysKdKEDjwU2QL CWENRXbItqP7LwWI4E7fo2DFY5AMNtFkY5Xy+zMFbC78VMhYG4vF2Ety91MV65rk cBCLmW/kztOVf983gzH7krDDQur/ZkOqTCzV8o4sYlWPhoRCkgdLSumCvlCjq6no MwAQbcFjLbSiVAFIho2axOhWcsmh97ye1bYQnUgDWHZqBhwRpU07C+yEcLqUDu/i YLCzPAsEYeQcB3Lm5fW0iDedKB+kWFQsrDkm9xsDpyrz6FovHf+HUeXvfvUIFUH5 My0SsRBRahk0GVOLEtIR/S8xrG5nZbgokKCknoIlMhbtpei0BsozXitRCS8jTLc= =L+Ek -----END PGP SIGNATURE----- --Qh3l1Q9vS0NBSEF1wiGiwKCbKie7dhWN6--