[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200211053401.GE10776@dread.disaster.area>
Date: Tue, 11 Feb 2020 16:34:01 +1100
From: Dave Chinner <david@...morbit.com>
To: ira.weiny@...el.com
Cc: linux-kernel@...r.kernel.org, Jan Kara <jack@...e.cz>,
Alexander Viro <viro@...iv.linux.org.uk>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Dan Williams <dan.j.williams@...el.com>,
Christoph Hellwig <hch@....de>,
"Theodore Y. Ts'o" <tytso@....edu>, linux-ext4@...r.kernel.org,
linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v3 05/12] fs: remove unneeded IS_DAX() check
On Sat, Feb 08, 2020 at 11:34:38AM -0800, ira.weiny@...el.com wrote:
> From: Ira Weiny <ira.weiny@...el.com>
>
> The IS_DAX() check in io_is_direct() causes a race between changing the
> DAX state and creating the iocb flags.
>
> Remove the check because DAX now emulates the page cache API and
> therefore it does not matter if the file state is DAX or not when the
> iocb flags are created.
This statement is ... weird.
DAX doesn't "emulate" the page cache API at all - it has it's own
read/write methods that filesystems call based on the iomap
infrastructure (dax_iomap_rw()). i.e. there are 3 different IO paths
through the filesystems: the DAX IO path, the direct IO path, and
the buffered IO path.
Indeed, it seems like this works a bit by luck: Ext4 and XFS always
check IS_DAX(inode) in the read/write_iter methods before checking
for IOCB_DIRECT, and hence the IOCB_DIRECT flag is ignored by the
filesystems. i.e. when we got rid of the O_DIRECT paths from DAX, we
forgot to clean up io_is_direct() and it's only due to the ordering
of checks that we went down the DAX path correctly....
That said, the code change is good, but the commit message needs a
rewrite.
Cheers,
Dave.
--
Dave Chinner
david@...morbit.com
Powered by blists - more mailing lists