From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBlbD-0005ZV-J6 for qemu-devel@nongnu.org; Fri, 07 Feb 2014 08:36:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBlb7-0007Ky-Ke for qemu-devel@nongnu.org; Fri, 07 Feb 2014 08:36:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBlb7-0007KO-DB for qemu-devel@nongnu.org; Fri, 07 Feb 2014 08:36:01 -0500 Message-ID: <52F4E15E.3020109@redhat.com> Date: Fri, 07 Feb 2014 15:36:30 +0200 From: Orit Wasserman MIME-Version: 1.0 References: <52F46298.8020602@ozlabs.ru> <52F48F3A.40606@redhat.com> <52F4CD3E.1000809@ozlabs.ru> <52F4D5C6.1050206@redhat.com> <52F4D778.6070001@beyond.pl> In-Reply-To: <52F4D778.6070001@beyond.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] migration question: disk images on nfs server List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TWFyY2luIEdpYnXFgmE=?= , Alexey Kardashevskiy , qemu-devel@nongnu.org On 02/07/2014 02:54 PM, Marcin Gibu=C5=82a wrote: >> It is more a NFS issue, if you have a file in NFS that two users in >> two different host are accessing (one at least write to it) you will >> need to enforce the "sync" option. >> Even if you flush all the data and close the file the NFS client can s= till >> have cached data that it didn't sync to the server. > > Do you know if is applies to linux O_DIRECT writes as well? > From the man of open: The behaviour of O_DIRECT with NFS will differ from local filesystems. Older kernels, or kernels configured in certain way= s, may not support this combination. The NFS protocol does not supp= ort passing the flag to the server, so O_DIRECT I/O will bypass the p= age cache only on the client; the server may still cache the I/O. Th= e client asks the server to make the I/O synchronous to preserve th= e synchronous semantics of O_DIRECT. Some servers will perform poo= rly under these circumstances, especially if the I/O size is small. = Some servers may also be configured to lie to clients about the I/O ha= ving reached stable storage; this will avoid the performance penalty a= t some risk to data integrity in the event of server power failure. The Linux NFS client places no alignment restrictions on O_DIRECT I/O. =20 To summaries it depends on your kernel (NFS client). > From comment in fs/nfs/direct.c: > > * When an application requests uncached I/O, all read and write request= s > * are made directly to the server; data stored or fetched via these > * requests is not cached in the Linux page cache. The client does not > * correct unaligned requests from applications. All requested bytes ar= e > * held on permanent storage before a direct write system call returns t= o > * an application. > > >