public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: don't set DAX flag for v2 inodes
@ 2017-08-30 15:55 Darrick J. Wong
  2017-08-30 16:15 ` Christoph Hellwig
  2017-08-30 16:38 ` [PATCH v2] xfs: don't set v3 xflags " Darrick J. Wong
  0 siblings, 2 replies; 17+ messages in thread
From: Darrick J. Wong @ 2017-08-30 15:55 UTC (permalink / raw)
  To: xfs; +Cc: Jan Kara, Christoph Hellwig

The DAX flag can only be persisted for v3 inodes, so don't allow users
to set the flag on older filesystems.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_ioctl.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 9c0c7a9..fa17f89 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -1043,6 +1043,10 @@ xfs_ioctl_setattr_xflags(
 	if ((fa->fsx_xflags & FS_XFLAG_DAX) && xfs_is_reflink_inode(ip))
 		return -EINVAL;
 
+	/* Don't allow us to set DAX mode for a non-v3 inode. */
+	if ((fa->fsx_xflags & FS_XFLAG_DAX) && ip->i_d.di_version < 3)
+		return -EINVAL;
+
 	/*
 	 * Can't modify an immutable/append-only file unless
 	 * we have appropriate permission.

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-09-01 20:08 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-30 15:55 [PATCH] xfs: don't set DAX flag for v2 inodes Darrick J. Wong
2017-08-30 16:15 ` Christoph Hellwig
2017-08-30 16:22   ` Darrick J. Wong
2017-08-30 16:38 ` [PATCH v2] xfs: don't set v3 xflags " Darrick J. Wong
2017-08-31 13:17   ` Christoph Hellwig
2017-08-31 13:34     ` Brian Foster
2017-08-31 14:06       ` Christoph Hellwig
2017-08-31 14:09       ` Christoph Hellwig
2017-08-31 14:17         ` Brian Foster
2017-08-31 19:57         ` Darrick J. Wong
2017-09-01  7:21           ` Christoph Hellwig
2017-09-01 17:52             ` Darrick J. Wong
2017-09-01 19:29               ` Christoph Hellwig
2017-09-01 19:40                 ` Darrick J. Wong
2017-09-01 20:06                   ` Darrick J. Wong
2017-09-01 20:08                     ` Christoph Hellwig
2017-08-31 13:35   ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox