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


Groups > linux.kernel > #1739341 > unrolled thread

[PATCH 2/7] xfs: validate bdev support for DAX inode flag

Started byRoss Zwisler <ross.zwisler@linux.intel.com>
First post2017-09-26 01:20 +0200
Last post2017-09-26 20:10 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/7] xfs: validate bdev support for DAX inode flag Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-09-26 01:20 +0200
    Re: [PATCH 2/7] xfs: validate bdev support for DAX inode flag Christoph Hellwig <hch@lst.de> - 2017-09-26 08:40 +0200
      Re: [PATCH 2/7] xfs: validate bdev support for DAX inode flag Ross Zwisler <ross.zwisler@linux.intel.com> - 2017-09-26 19:20 +0200
        Re: [PATCH 2/7] xfs: validate bdev support for DAX inode flag "Darrick J. Wong" <darrick.wong@oracle.com> - 2017-09-26 20:10 +0200

#1739341 — [PATCH 2/7] xfs: validate bdev support for DAX inode flag

FromRoss Zwisler <ross.zwisler@linux.intel.com>
Date2017-09-26 01:20 +0200
Subject[PATCH 2/7] xfs: validate bdev support for DAX inode flag
Message-ID<utKPq-4Lc-25@gated-at.bofh.it>
Currently only the blocksize is checked, but we should really be calling
bdev_dax_supported() which also tests to make sure we can get a
struct dax_device and that the dax_direct_access() path is working.

This is the same check that we do for the "-o dax" mount option in
xfs_fs_fill_super().

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_ioctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 26faeb9..0433aef 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -1088,6 +1088,7 @@ xfs_ioctl_setattr_dax_invalidate(
 	int			*join_flags)
 {
 	struct inode		*inode = VFS_I(ip);
+	struct super_block	*sb = inode->i_sb;
 	int			error;
 
 	*join_flags = 0;
@@ -1100,7 +1101,7 @@ xfs_ioctl_setattr_dax_invalidate(
 	if (fa->fsx_xflags & FS_XFLAG_DAX) {
 		if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)))
 			return -EINVAL;
-		if (ip->i_mount->m_sb.sb_blocksize != PAGE_SIZE)
+		if (bdev_dax_supported(sb, sb->s_blocksize) < 0)
 			return -EINVAL;
 	}
 
-- 
2.9.5

[toc] | [next] | [standalone]


#1739543

FromChristoph Hellwig <hch@lst.de>
Date2017-09-26 08:40 +0200
Message-ID<utRHc-10R-17@gated-at.bofh.it>
In reply to#1739341
On Mon, Sep 25, 2017 at 05:13:59PM -0600, Ross Zwisler wrote:
> Currently only the blocksize is checked, but we should really be calling
> bdev_dax_supported() which also tests to make sure we can get a
> struct dax_device and that the dax_direct_access() path is working.
> 
> This is the same check that we do for the "-o dax" mount option in
> xfs_fs_fill_super().
> 
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>

I think we just want to pick this up ASAP.  And between my vague
memoried and that reviewed-by tag it already was part of a different
series, wasn't it?

[toc] | [prev] | [next] | [standalone]


#1740044

FromRoss Zwisler <ross.zwisler@linux.intel.com>
Date2017-09-26 19:20 +0200
Message-ID<uu1Gy-7EH-7@gated-at.bofh.it>
In reply to#1739543
On Tue, Sep 26, 2017 at 08:36:50AM +0200, Christoph Hellwig wrote:
> On Mon, Sep 25, 2017 at 05:13:59PM -0600, Ross Zwisler wrote:
> > Currently only the blocksize is checked, but we should really be calling
> > bdev_dax_supported() which also tests to make sure we can get a
> > struct dax_device and that the dax_direct_access() path is working.
> > 
> > This is the same check that we do for the "-o dax" mount option in
> > xfs_fs_fill_super().
> > 
> > Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> > Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> I think we just want to pick this up ASAP.  And between my vague
> memoried and that reviewed-by tag it already was part of a different
> series, wasn't it?

Yep, the first 2 patches were part of this series:

https://lkml.org/lkml/2017/9/7/552

which you reviewed.  I included them in this series because the later patches
needed to build on them.  It looks like they are now in Darrick's
xfs-4.14-fixes branch, but haven't yet made it upstream.

[toc] | [prev] | [next] | [standalone]


#1740088

From"Darrick J. Wong" <darrick.wong@oracle.com>
Date2017-09-26 20:10 +0200
Message-ID<uu2sX-8cl-53@gated-at.bofh.it>
In reply to#1740044
On Tue, Sep 26, 2017 at 11:16:38AM -0600, Ross Zwisler wrote:
> On Tue, Sep 26, 2017 at 08:36:50AM +0200, Christoph Hellwig wrote:
> > On Mon, Sep 25, 2017 at 05:13:59PM -0600, Ross Zwisler wrote:
> > > Currently only the blocksize is checked, but we should really be calling
> > > bdev_dax_supported() which also tests to make sure we can get a
> > > struct dax_device and that the dax_direct_access() path is working.
> > > 
> > > This is the same check that we do for the "-o dax" mount option in
> > > xfs_fs_fill_super().
> > > 
> > > Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> > > Reviewed-by: Christoph Hellwig <hch@lst.de>
> > 
> > I think we just want to pick this up ASAP.  And between my vague
> > memoried and that reviewed-by tag it already was part of a different
> > series, wasn't it?
> 
> Yep, the first 2 patches were part of this series:
> 
> https://lkml.org/lkml/2017/9/7/552
> 
> which you reviewed.  I included them in this series because the later patches
> needed to build on them.  It looks like they are now in Darrick's
> xfs-4.14-fixes branch, but haven't yet made it upstream.

I'm pulling that first patch from -fixes because Dave & Christoph
started discussing it again in this new thread after I'd pushed the
patch from September 7th to korg.

The second patch looks fine, it'll stay.

--D

> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web