Re: [PATCH 3/7] xfs: protect S_DAX transitions in XFS read path

2017-10-01 Thread Christoph Hellwig
On Tue, Sep 26, 2017 at 11:11:55AM -0700, Dan Williams wrote: > I think we'll always need an explicit override available, but yes we > need to think about what the override looks like in the context of a > kernel that is able to automatically pick the right I/O policy > relative to the media type.

Re: [PATCH 3/7] xfs: protect S_DAX transitions in XFS read path

2017-09-26 Thread Dan Williams
On Tue, Sep 26, 2017 at 7:33 AM, Christoph Hellwig wrote: > On Tue, Sep 26, 2017 at 06:59:37AM -0700, Dan Williams wrote: >> > I think you probably want an IOCB_DAX flag to check IS_DAX once and >> > then stick to it, similar to what we do for direct I/O. >> >> I wonder if this works better with a

Re: [PATCH 3/7] xfs: protect S_DAX transitions in XFS read path

2017-09-26 Thread Christoph Hellwig
On Tue, Sep 26, 2017 at 06:59:37AM -0700, Dan Williams wrote: > > I think you probably want an IOCB_DAX flag to check IS_DAX once and > > then stick to it, similar to what we do for direct I/O. > > I wonder if this works better with a reference count mechanism > per-file so that we don't need a ho

Re: [PATCH 3/7] xfs: protect S_DAX transitions in XFS read path

2017-09-26 Thread Dan Williams
On Mon, Sep 25, 2017 at 11:32 PM, Christoph Hellwig wrote: > We can't just take locking one level up, as we need differnet locking > for different kinds of I/O. > > I think you probably want an IOCB_DAX flag to check IS_DAX once and > then stick to it, similar to what we do for direct I/O. I wond

Re: [PATCH 3/7] xfs: protect S_DAX transitions in XFS read path

2017-09-25 Thread Christoph Hellwig
We can't just take locking one level up, as we need differnet locking for different kinds of I/O. I think you probably want an IOCB_DAX flag to check IS_DAX once and then stick to it, similar to what we do for direct I/O.

Re: [PATCH 3/7] xfs: protect S_DAX transitions in XFS read path

2017-09-25 Thread Dave Chinner
On Mon, Sep 25, 2017 at 05:14:00PM -0600, Ross Zwisler wrote: > In the current XFS read I/O path we check IS_DAX() in xfs_file_read_iter() > to decide whether to do DAX I/O, direct I/O or buffered I/O. This check is > done without holding the XFS_IOLOCK, though, which means that if we allow > S_DA

[PATCH 3/7] xfs: protect S_DAX transitions in XFS read path

2017-09-25 Thread Ross Zwisler
In the current XFS read I/O path we check IS_DAX() in xfs_file_read_iter() to decide whether to do DAX I/O, direct I/O or buffered I/O. This check is done without holding the XFS_IOLOCK, though, which means that if we allow S_DAX to be manipulated via the inode flag we can run into this race: CPU