xfs
[Top] [All Lists]

[PATCH 2/5] xfs: keep sb_bad_features2 the same a sb_features2

To: xfs@xxxxxxxxxxx
Subject: [PATCH 2/5] xfs: keep sb_bad_features2 the same a sb_features2
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Sat, 17 May 2014 09:00:49 +1000
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1400281252-29638-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1400281252-29638-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

Whenever we update sb_features2, we need to update sb_bad_features2
so that they remain identical on disk. This prevents future mounts
or userspace utilities from getting confused over which features the
filesystem supports.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
---
 fs/xfs/xfs_sb.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/xfs/xfs_sb.h b/fs/xfs/xfs_sb.h
index c750126..9e6a3d5 100644
--- a/fs/xfs/xfs_sb.h
+++ b/fs/xfs/xfs_sb.h
@@ -468,11 +468,13 @@ static inline void xfs_sb_version_addattr2(struct xfs_sb 
*sbp)
 {
        sbp->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT;
        sbp->sb_features2 |= XFS_SB_VERSION2_ATTR2BIT;
+       sbp->sb_bad_features2 |= XFS_SB_VERSION2_ATTR2BIT;
 }
 
 static inline void xfs_sb_version_removeattr2(struct xfs_sb *sbp)
 {
        sbp->sb_features2 &= ~XFS_SB_VERSION2_ATTR2BIT;
+       sbp->sb_bad_features2 &= ~XFS_SB_VERSION2_ATTR2BIT;
        if (!sbp->sb_features2)
                sbp->sb_versionnum &= ~XFS_SB_VERSION_MOREBITSBIT;
 }
-- 
1.9.0

<Prev in Thread] Current Thread [Next in Thread>