From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from imap.thunk.org ([74.207.234.97]:45692 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752892AbcD0DZb (ORCPT ); Tue, 26 Apr 2016 23:25:31 -0400 Date: Tue, 26 Apr 2016 23:25:26 -0400 From: Theodore Ts'o To: Dave Chinner Cc: Christoph Hellwig , torvalds@linux-foundation.org, Dmitry Monakhov , Ext4 Developers List , linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: O_DIRECT as a hint, was: Re: [PATCH] ext4: refuse O_DIRECT opens for mode where DIO doesn't work Message-ID: <20160427032526.GC30021@thunk.org> References: <1461472078-20104-1-git-send-email-tytso@mit.edu> <877ffmhvzt.fsf@openvz.org> <20160425234946.GB26977@dastard> <20160426081451.GA25616@infradead.org> <20160427022746.GJ18496@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160427022746.GJ18496@dastard> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Apr 27, 2016 at 12:27:46PM +1000, Dave Chinner wrote: > > At this point I wonder if we should simply treat O_DIRECT as a hint > > and always allow it, and just let the file system optimize for it > > (skip buffering, require alignment, relaxed Posix atomicy requirements) > > if it is set. > > I thought that's how most filesystems treated it, anyway. i.e. > anything they can't do via direct IO, they fell back to buffered IO > to complete (e.g. for allocation or append writes, etc). Hence why I > suggested the fallback rather than erroring out.... No, some file systems return EINVAL on the open. In fact that's what the _require_odirect test in xfstests relies upon.... - Ted