linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bill O'Donnell <bodonnel@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH] xfs: dax: facilitate EXPERIMENTAL warning for dax=inode case
Date: Thu, 26 Aug 2021 12:30:12 -0500	[thread overview]
Message-ID: <20210826173012.273932-1-bodonnel@redhat.com> (raw)

When dax-mode was tri-stated by adding dax=inode case, the EXPERIMENTAL
warning on mount was missed for the case. Add logic to handle the
warning similar to that of the 'dax=always' case.

Signed-off-by: Bill O'Donnell <bodonnel@redhat.com>
---
 fs/xfs/xfs_mount.h | 2 ++
 fs/xfs/xfs_super.c | 8 +++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index e091f3b3fa15..c9243a1b8d05 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -277,6 +277,7 @@ typedef struct xfs_mount {
 #define XFS_FEAT_NEEDSREPAIR	(1ULL << 25)	/* needs xfs_repair */
 
 /* Mount features */
+#define XFS_FEAT_DAX_INODE	(1ULL << 47)	/* DAX enabled */
 #define XFS_FEAT_NOATTR2	(1ULL << 48)	/* disable attr2 creation */
 #define XFS_FEAT_NOALIGN	(1ULL << 49)	/* ignore alignment */
 #define XFS_FEAT_ALLOCSIZE	(1ULL << 50)	/* user specified allocation size */
@@ -359,6 +360,7 @@ __XFS_HAS_FEAT(swalloc, SWALLOC)
 __XFS_HAS_FEAT(filestreams, FILESTREAMS)
 __XFS_HAS_FEAT(dax_always, DAX_ALWAYS)
 __XFS_HAS_FEAT(dax_never, DAX_NEVER)
+__XFS_HAS_FEAT(dax_inode, DAX_INODE)
 __XFS_HAS_FEAT(norecovery, NORECOVERY)
 __XFS_HAS_FEAT(nouuid, NOUUID)
 
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 5e73ac78bf2f..f73f3687f0a8 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -84,15 +84,16 @@ xfs_mount_set_dax_mode(
 {
 	switch (mode) {
 	case XFS_DAX_INODE:
+		mp->m_features |= XFS_FEAT_DAX_INODE;
 		mp->m_features &= ~(XFS_FEAT_DAX_ALWAYS | XFS_FEAT_DAX_NEVER);
 		break;
 	case XFS_DAX_ALWAYS:
 		mp->m_features |= XFS_FEAT_DAX_ALWAYS;
-		mp->m_features &= ~XFS_FEAT_DAX_NEVER;
+		mp->m_features &= ~(XFS_FEAT_DAX_NEVER | XFS_FEAT_DAX_INODE);
 		break;
 	case XFS_DAX_NEVER:
 		mp->m_features |= XFS_FEAT_DAX_NEVER;
-		mp->m_features &= ~XFS_FEAT_DAX_ALWAYS;
+		mp->m_features &= ~(XFS_FEAT_DAX_ALWAYS | XFS_FEAT_DAX_INODE);
 		break;
 	}
 }
@@ -189,6 +190,7 @@ xfs_fs_show_options(
 		{ XFS_FEAT_LARGE_IOSIZE,	",largeio" },
 		{ XFS_FEAT_DAX_ALWAYS,		",dax=always" },
 		{ XFS_FEAT_DAX_NEVER,		",dax=never" },
+		{ XFS_FEAT_DAX_INODE,		",dax=inode" },
 		{ 0, NULL }
 	};
 	struct xfs_mount	*mp = XFS_M(root->d_sb);
@@ -1584,7 +1586,7 @@ xfs_fs_fill_super(
 	if (xfs_has_crc(mp))
 		sb->s_flags |= SB_I_VERSION;
 
-	if (xfs_has_dax_always(mp)) {
+	if (xfs_has_dax_always(mp) || xfs_has_dax_inode(mp)) {
 		bool rtdev_is_dax = false, datadev_is_dax;
 
 		xfs_warn(mp,
-- 
2.31.1


             reply	other threads:[~2021-08-26 17:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 17:30 Bill O'Donnell [this message]
2021-08-26 18:09 ` Darrick J. Wong
2021-08-26 18:14   ` Bill O'Donnell
2021-08-26 18:16   ` Eric Sandeen
2021-08-26 22:08     ` Bill O'Donnell
2021-08-26 23:43       ` Eric Sandeen
2021-08-27 14:03         ` Bill O'Donnell
2021-08-27 14:18           ` Eric Sandeen
2021-08-27 14:25             ` Bill O'Donnell
2021-08-27 15:35               ` Eric Sandeen
2021-08-27 15:41                 ` Bill O'Donnell
2021-08-30 15:55   ` Bill O'Donnell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210826173012.273932-1-bodonnel@redhat.com \
    --to=bodonnel@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --subject='Re: [PATCH] xfs: dax: facilitate EXPERIMENTAL warning for dax=inode case' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).