From: Darrick J. Wong Date: Mon, 31 Jan 2022 20:25:47 +0000 (-0500) Subject: xfs: allow setting and clearing of log incompat feature flags X-Git-Tag: v5.15.0-rc0~40 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=aaf3c5c94e0e24c2179b2e98ebfd798d1a69fc0e;p=thirdparty%2Fxfsprogs-dev.git xfs: allow setting and clearing of log incompat feature flags Source kernel commit: 908ce71e54f8265fa909200410d6c50ab9a2d302 Log incompat feature flags in the superblock exist for one purpose: to protect the contents of a dirty log from replay on a kernel that isn't prepared to handle those dirty contents. This means that they can be cleared if (a) we know the log is clean and (b) we know that there aren't any other threads in the system that might be setting or relying upon a log incompat flag. Therefore, clear the log incompat flags when we've finished recovering the log, when we're unmounting cleanly, remounting read-only, or freezing; and provide a function so that subsequent patches can start using this. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Chandan Babu R Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h index 37570cf05..5d8a12915 100644 --- a/libxfs/xfs_format.h +++ b/libxfs/xfs_format.h @@ -495,6 +495,21 @@ xfs_sb_has_incompat_log_feature( return (sbp->sb_features_log_incompat & feature) != 0; } +static inline void +xfs_sb_remove_incompat_log_features( + struct xfs_sb *sbp) +{ + sbp->sb_features_log_incompat &= ~XFS_SB_FEAT_INCOMPAT_LOG_ALL; +} + +static inline void +xfs_sb_add_incompat_log_features( + struct xfs_sb *sbp, + unsigned int features) +{ + sbp->sb_features_log_incompat |= features; +} + /* * V5 superblock specific feature checks */