From: Christoph Hellwig Subject: Re: [PATCH] Allow O_SYNC to be set by fcntl(F_SETFL) Date: Fri, 8 Apr 2011 11:14:55 -0400 Message-ID: <20110408151454.GA1444@infradead.org> References: <4D6824A4.6030009@nec-labs.com> <20110407143719.4044c00d.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Steve Rago , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Andrew Morton Return-path: Content-Disposition: inline In-Reply-To: <20110407143719.4044c00d.akpm@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org I actually prototypes this patch independetly a while ago, and in addition to the data writeout when removing O_SYNC there are the following caveats: - O_SYNC is not actually one flag, but two: O_DSYNC and __O_SYNC. setfl() needs to make sure __O_SYNC cannot be in f_flags without O_DSYNC also beeing present. - we need to audit all filesystems that they don't do stupid things when the O_SYNC flags appear or disappear during a write, that is make sure it is checked in just one place. The generic write code is fine in that respect, but I didn't go through all filesystems to verify it yet.