aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <[email protected]>2024-04-22 09:47:24 -0700
committerDarrick J. Wong <[email protected]>2024-04-23 07:46:51 -0700
commit8ef1d96a985e4dc07ffbd71bd7fc5604a80cc644 (patch)
treefd8f7d01b2716e53c3fd1b9deffb0ff23620175f
parentef80de940a6344da1d4f12c948a0ad4d6ff6e841 (diff)
xfs: require XFS_SB_FEAT_INCOMPAT_LOG_XATTRS for attr log intent item recovery
The XFS_SB_FEAT_INCOMPAT_LOG_XATTRS feature bit protects a filesystem from old kernels that do not know how to recover extended attribute log intent items. Make this check mandatory instead of a debugging assert. Fixes: fd920008784ea ("xfs: Set up infrastructure for log attribute replay") Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
-rw-r--r--fs/xfs/xfs_attr_item.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c
index 541455731618..dfe7039dac98 100644
--- a/fs/xfs/xfs_attr_item.c
+++ b/fs/xfs/xfs_attr_item.c
@@ -469,6 +469,9 @@ xfs_attri_validate(
unsigned int op = attrp->alfi_op_flags &
XFS_ATTRI_OP_FLAGS_TYPE_MASK;
+ if (!xfs_sb_version_haslogxattrs(&mp->m_sb))
+ return false;
+
if (attrp->__pad != 0)
return false;
@@ -570,8 +573,6 @@ xfs_attri_recover_work(
XFS_DA_OP_LOGGED;
args->owner = args->dp->i_ino;
- ASSERT(xfs_sb_version_haslogxattrs(&mp->m_sb));
-
switch (attr->xattri_op_flags) {
case XFS_ATTRI_OP_FLAGS_SET:
case XFS_ATTRI_OP_FLAGS_REPLACE: