From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: adding proper O_SYNC/O_DSYNC, was Re: O_DIRECT and barriers Date: Thu, 27 Aug 2009 13:10:44 -0400 Message-ID: <20090827171044.GA5427@infradead.org> References: <1250697884-22288-1-git-send-email-jack@suse.cz> <20090820221221.GA14440@infradead.org> <20090821114010.GG12579@kernel.dk> <20090821135403.GA6208@shareable.org> <20090821142635.GB30617@infradead.org> <20090821152459.GC6929@shareable.org> <20090821174525.GA28861@infradead.org> <20090822005006.GA22530@shareable.org> <20090824023422.GA775@infradead.org> <20090827143459.GB31453@shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Jamie Lokier , Ulrich Drepper Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:51293 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751129AbZH0RKw (ORCPT ); Thu, 27 Aug 2009 13:10:52 -0400 Content-Disposition: inline In-Reply-To: <20090827143459.GB31453@shareable.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Aug 27, 2009 at 03:34:59PM +0100, Jamie Lokier wrote: > Christoph Hellwig wrote: > > Then again they already don't get what they expect and never did, > > so if we clear document and communicate the O_SYNC (that is Linux > > O_SYNC) requirement we might be able to go with this. > > I'm thinking, while we're looking at this, that now is a really good > time to split up O_SYNC and O_DSYNC. > > We have separate fsync and fdatasync, so it should be quite tidy now. > > Then we can document using O_DSYNC on Linux, which is fine for older > versions because it has the same value as O_SYNC at the moment. Technically we could easily make O_SYNC really mean O_SYNC and implement a seaprate O_DSYNC at the kernel level. The question is how to handle this at the libc level. Currently glibc defines O_DSYNC to be O_SYNC. We would need to update glibc to pass through O_DSYNC for newer kernels and make sure it falls back to O_SYNC for olders. I'm not sure how feasible this is, but maybe Ulrich has some better ideas.