From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Dilger Subject: Re: Question : are concurrent write() calls with O_APPEND on local files atomic ? Date: Wed, 19 Aug 2009 20:10:05 -0600 Message-ID: <20090820021005.GZ5931@webber.adilger.int> References: <531F9EE7AD1E874595D59997FD3EAEED052EB15C@COSSMGMBX05.EMAIL.CORP.TLD> <20090819131749.GA7761@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT Cc: "Cornelius, Martin (DWBI)" , linux-fsdevel@vger.kernel.org, "Roeder, Patrick (DWBI)" To: Josef Bacik Return-path: Received: from sca-es-mail-2.Sun.COM ([192.18.43.133]:61118 "EHLO sca-es-mail-2.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752749AbZHTCKC (ORCPT ); Wed, 19 Aug 2009 22:10:02 -0400 Received: from fe-sfbay-10.sun.com ([192.18.43.129]) by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n7K2A3J2013447 for ; Wed, 19 Aug 2009 19:10:03 -0700 (PDT) Content-disposition: inline Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) id <0KON00500KKX6100@fe-sfbay-10.sun.com> for linux-fsdevel@vger.kernel.org; Wed, 19 Aug 2009 19:10:03 -0700 (PDT) In-reply-to: <20090819131749.GA7761@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Aug 19, 2009 09:17 -0400, Josef Bacik wrote: > > - does this guarantee also hold for remote filesystems (nfs / smb) ? > > This I'm more likely to be wrong on, but I don't think so. It would be atomic > on the local machine, but if there is somebody else on another machine writing > to the same file I think you would probably be screwed. With NFS at least, there is absolutely no guarantee of any kind when multiple clients write to the same file, even with non-overlapping writes (i.e. no O_APPEND, but application seeks to different file offsets). That is because an NFS client does not necessarily flush its local cache until it closes the file. Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc.