From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: adding proper O_SYNC/O_DSYNC, was Re: O_DIRECT and barriers Date: Fri, 28 Aug 2009 17:50:49 +0100 Message-ID: <20090828165049.GC8036@shareable.org> References: <20090821142635.GB30617@infradead.org> <20090821152459.GC6929@shareable.org> <20090821174525.GA28861@infradead.org> <20090822005006.GA22530@shareable.org> <20090824023422.GA775@infradead.org> <20090827143459.GB31453@shareable.org> <20090827171044.GA5427@infradead.org> <4A96C14C.8040105@redhat.com> <20090828154647.GA15808@infradead.org> <20090828164432.GA8036@shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Ulrich Drepper , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from mail2.shareable.org ([80.68.89.115]:41233 "EHLO mail2.shareable.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751710AbZH1Qux (ORCPT ); Fri, 28 Aug 2009 12:50:53 -0400 Content-Disposition: inline In-Reply-To: <20090828164432.GA8036@shareable.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Jamie Lokier wrote: > That's because this thread is the first time I've heard that Linux > O_SYNC was really the weaker O_DSYNC in disguise, and judging from the > many Googlings I've done about O_SYNC in applications and on different > OS, it'll be news to other people too. > > (I always thought the "#define O_DSYNC O_SYNC" was because Linux > didn't implement the weaker O_DSYNC). It looks like we're not the only ones. AIX has: http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/com.ibm.aix.genprogc/doc/genprogc/fileio.htm Before the O_DSYNC open mode existed, AIX applied O_DSYNC semantics to O_SYNC. For binary compatibility reasons, this behavior still exists. If true O_SYNC behavior is required, then both O_DSYNC and O_SYNC open flags must be specified. Exporting the XPG_SUS_ENV=ON environment variable also enables true O_SYNC behavior. -- Jamie