Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1740129

Re: [PATCH 1/7] xfs: always use DAX if mount option is used

From Ross Zwisler <ross.zwisler@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/7] xfs: always use DAX if mount option is used
Date 2017-09-26 21:00 +0200
Message-ID <uu3fl-8sI-47@gated-at.bofh.it> (permalink)
References <utKPp-4Lc-5@gated-at.bofh.it> <utKPp-4Lc-13@gated-at.bofh.it> <utLV8-5su-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Sep 26, 2017 at 09:38:12AM +1000, Dave Chinner wrote:
> On Mon, Sep 25, 2017 at 05:13:58PM -0600, Ross Zwisler wrote:
> > Before support for the per-inode DAX flag was disabled the XFS the code had
> > an issue where the user couldn't reliably tell whether or not DAX was being
> > used to service page faults and I/O when the DAX mount option was used.  In
> > this case each inode within the mounted filesystem started with S_DAX set
> > due to the mount option, but it could be cleared if someone touched the
> > individual inode flag.
> > 
> > For example (v4.13 and before):
> > 
> >   # mount | grep dax
> >   /dev/pmem0 on /mnt type xfs
> >   (rw,relatime,seclabel,attr2,dax,inode64,sunit=4096,swidth=4096,noquota)
> > 
> >   # touch /mnt/a /mnt/b   # both files currently use DAX
> > 
> >   # xfs_io -c "lsattr" /mnt/*  # neither has the DAX inode option set
> >   ----------e----- /mnt/a
> >   ----------e----- /mnt/b
> > 
> >   # xfs_io -c "chattr -x" /mnt/a  # this clears S_DAX for /mnt/a
> > 
> >   # xfs_io -c "lsattr" /mnt/*
> >   ----------e----- /mnt/a
> >   ----------e----- /mnt/b
> 
> That's really a bug in the lsattr code, yes? If we've cleared the
> S_DAX flag for the inode, then why is it being reported in lsattr?
> Or if we failed to clear the S_DAX flag in the 'chattr -x' call,
> then isn't that the bug that needs fixing?

No, I think lsattr/chattr are working correctly.  In both the examples above
the DAX inode flag (which is represeted by an 'x') is never set.  S_DAX is the
in-memory inode flag (not the on-media inode flag) which is not manipulated
directly by lsattr/chattr, but instead reflects whether the inode is actually
using DAX or not.

Manipulating and displaying the on-media inode flag works as expected with
lsattr/chattr:

  # xfs_io -c "lsattr" ./a 
  ---------------- ./a 
  
  # xfs_io -c "chattr +x" ./a 
  
  # xfs_io -c "lsattr" ./a 
  --------------x- ./a 

- Ross

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/7] xfs: always use DAX if mount option is used Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-09-26 01:20 +0200
  Re: [PATCH 1/7] xfs: always use DAX if mount option is used Dave Chinner <david@fromorbit.com> - 2017-09-26 02:30 +0200
    Re: [PATCH 1/7] xfs: always use DAX if mount option is used Jan Kara <jack@suse.cz> - 2017-09-26 11:40 +0200
      Re: [PATCH 1/7] xfs: always use DAX if mount option is used Dave Chinner <david@fromorbit.com> - 2017-09-26 13:20 +0200
        Re: [PATCH 1/7] xfs: always use DAX if mount option is used Christoph Hellwig <hch@lst.de> - 2017-09-26 16:40 +0200
          Re: [PATCH 1/7] xfs: always use DAX if mount option is used Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-09-26 19:40 +0200
            Re: [PATCH 1/7] xfs: always use DAX if mount option is used "Darrick J. Wong" <darrick.wong@oracle.com> - 2017-09-26 22:00 +0200
              Re: [PATCH 1/7] xfs: always use DAX if mount option is used Dave Chinner <david@fromorbit.com> - 2017-09-27 00:10 +0200
            Re: [PATCH 1/7] xfs: always use DAX if mount option is used Christoph Hellwig <hch@infradead.org> - 2017-09-27 08:50 +0200
              Re: [PATCH 1/7] xfs: always use DAX if mount option is used Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-09-27 18:20 +0200
                Re: [PATCH 1/7] xfs: always use DAX if mount option is used Christoph Hellwig <hch@lst.de> - 2017-10-01 10:20 +0200
        Re: [PATCH 1/7] xfs: always use DAX if mount option is used Eric Sandeen <sandeen@sandeen.net> - 2017-09-26 20:10 +0200
    Re: [PATCH 1/7] xfs: always use DAX if mount option is used Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-09-26 21:00 +0200

csiph-web