diff mbox series

[23/23] xfs: make XFS_SB_FEAT_INCOMPAT_LOG_EXCHMAPS sticky for parent pointers

Message ID 171079802249.3806377.3291293823520148572.stgit@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series [01/23] xfs: Expose init_xattrs in xfs_create_tmpfile | expand

Commit Message

Darrick J. Wong March 18, 2024, 9:47 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Directory parent pointers make directory repairs practical.  However,
online repairs of directories (and parent pointers which are embedded in
extended attributes) must commit the repairs atomically by building a
replacement structure in a temporary file and then exchanging the
contents.

Although there's no hard dependency between parent pointers and file
mapping exchanges like there is with logged xattr updates, these two
features will likely go hand in hand.  Make sure we always have the
exchmaps bit turned on.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/xfs_mount.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 62351fdde2c80..348aa9e9d439a 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -635,6 +635,20 @@  xfs_mountfs_set_perm_log_features(
 		 * updates.  Set the LARP bit.
 		 */
 		mp->m_perm_log_incompat |= XFS_SB_FEAT_INCOMPAT_LOG_XATTRS;
+
+		/*
+		 * Directory parent pointers make directory repairs practical.
+		 * However, online repairs of directories (and parent pointers
+		 * which are embedded in extended attributes) must commit the
+		 * repairs atomically by building a replacement structure in a
+		 * temporary file and then exchanging the contents.
+		 *
+		 * Although there's no hard dependency between parent pointers
+		 * and file mapping exchanges like there is with logged xattr
+		 * updates, these two features will likely go hand in hand.
+		 * Set the exchmaps bit.
+		 */
+		mp->m_perm_log_incompat |= XFS_SB_FEAT_INCOMPAT_LOG_EXCHMAPS;
 	}
 
 	/* Make sure the permanent bits are set in the ondisk primary super. */