Il 07/02/2014 10:41, Marcin Gibuła ha scritto: >> For NFS you need to use the sync mount option to force the NFS client to >> sync to >> server on writes. > > Isn't opening with O_DIRECT enough? (for linux nfs client at least)
Yeah, the man page says: If neither sync nor async is specified (or if the async option is specified), the NFS client delays sending appli‐ cation writes to the server until any of these events occur: Memory pressure forces reclamation of system memory resources. An application flushes file data explicitly with sync(2), msync(2), or fsync(3). An application closes a file with close(2). The file is locked/unlocked via fcntl(2). In other words, under normal circumstances, data written by an applica‐ tion may not immediately appear on the server that hosts the file. QEMU does flush file data with fsync(3). It's not the first time I hear about needing the sync option though. Paolo