Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32bf1dea authored by Dave Chinner's avatar Dave Chinner Committed by Dave Chinner
Browse files

xfs: keep sb_bad_features2 the same a sb_features2



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: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent f68a3735
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
}