From e6957ea48429aeda4f5d51af4238231d44b0dc4a Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Thu, 10 Apr 2008 12:19:34 +1000 Subject: [XFS] Ensure "both" features2 slots are consistent Since older kernels may look in the sb_bad_features2 slot for flags, rather than zeroing it out on fixup, we should make it equal to the sb_features2 value. Also, if the ATTR2 flag was not found prior to features2 fixup, it was not set in the mount flags, so re-check after the fixup so that the current session will use the feature. Also fix up the comments to reflect these changes. SGI-PV: 980085 SGI-Modid: xfs-linux-melb:xfs-kern:30778a Signed-off-by: Eric Sandeen Signed-off-by: David Chinner Signed-off-by: Lachlan McIlroy --- fs/xfs/xfs_sb.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'fs/xfs/xfs_sb.h') diff --git a/fs/xfs/xfs_sb.h b/fs/xfs/xfs_sb.h index b1a83f8..d904efe 100644 --- a/fs/xfs/xfs_sb.h +++ b/fs/xfs/xfs_sb.h @@ -320,11 +320,12 @@ static inline int xfs_sb_good_version(xfs_sb_t *sbp) #endif /* __KERNEL__ */ /* - * Detect a bad features2 field + * Detect a mismatched features2 field. Older kernels read/wrote + * this into the wrong slot, so to be safe we keep them in sync. */ -static inline int xfs_sb_has_bad_features2(xfs_sb_t *sbp) +static inline int xfs_sb_has_mismatched_features2(xfs_sb_t *sbp) { - return (sbp->sb_bad_features2 != 0); + return (sbp->sb_bad_features2 != sbp->sb_features2); } static inline unsigned xfs_sb_version_tonew(unsigned v) -- cgit v1.1