Commit 7c12f296 authored by Tim Shimmin's avatar Tim Shimmin Committed by Niv Sardi
Browse files

[XFS] Fix up noattr2 so that it will properly update the versionnum and


features2 fields.

Previously, mounting with noattr2 failed to achieve anything because
although it cleared the attr2 mount flag, it would set it again as soon as
it processed the superblock fields. The fix now has an explicit noattr2
flag and uses it later to fix up the versionnum and features2 fields.

SGI-PV: 980021
SGI-Modid: xfs-linux-melb:xfs-kern:31003a

Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
parent f9f6dce0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -314,6 +314,7 @@ xfs_parseargs(
			args->flags |= XFSMNT_ATTR2;
		} else if (!strcmp(this_char, MNTOPT_NOATTR2)) {
			args->flags &= ~XFSMNT_ATTR2;
			args->flags |= XFSMNT_NOATTR2;
		} else if (!strcmp(this_char, MNTOPT_FILESTREAM)) {
			args->flags2 |= XFSMNT2_FILESTREAMS;
		} else if (!strcmp(this_char, MNTOPT_NOQUOTA)) {
+1 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ struct xfs_mount_args {
#define XFSMNT_IOSIZE		0x00002000	/* optimize for I/O size */
#define XFSMNT_OSYNCISOSYNC	0x00004000	/* o_sync is REALLY o_sync */
						/* (osyncisdsync is default) */
#define XFSMNT_NOATTR2		0x00008000	/* turn off ATTR2 EA format */
#define XFSMNT_32BITINODES	0x00200000	/* restrict inodes to 32
						 * bits of address space */
#define XFSMNT_GQUOTA		0x00400000	/* group quota accounting */
+11 −1
Original line number Diff line number Diff line
@@ -994,9 +994,19 @@ xfs_mountfs(
		 * Re-check for ATTR2 in case it was found in bad_features2
		 * slot.
		 */
		if (xfs_sb_version_hasattr2(&mp->m_sb))
		if (xfs_sb_version_hasattr2(&mp->m_sb) &&
		   !(mp->m_flags & XFS_MOUNT_NOATTR2))
			mp->m_flags |= XFS_MOUNT_ATTR2;
	}

	if (xfs_sb_version_hasattr2(&mp->m_sb) &&
	   (mp->m_flags & XFS_MOUNT_NOATTR2)) {
		xfs_sb_version_removeattr2(&mp->m_sb);
		update_flags |= XFS_SB_FEATURES2;

		/* update sb_versionnum for the clearing of the morebits */
		if (!sbp->sb_features2)
			update_flags |= XFS_SB_VERSIONNUM;
	}

	/*
+1 −0
Original line number Diff line number Diff line
@@ -378,6 +378,7 @@ typedef struct xfs_mount {
						   counters */
#define XFS_MOUNT_FILESTREAMS	(1ULL << 24)	/* enable the filestreams
						   allocator */
#define XFS_MOUNT_NOATTR2	(1ULL << 25)	/* disable use of attr2 format */


/*
+7 −0
Original line number Diff line number Diff line
@@ -473,6 +473,13 @@ static inline void xfs_sb_version_addattr2(xfs_sb_t *sbp)
		((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT)));
}

static inline void xfs_sb_version_removeattr2(xfs_sb_t *sbp)
{
	sbp->sb_features2 &= ~XFS_SB_VERSION2_ATTR2BIT;
	if (!sbp->sb_features2)
		sbp->sb_versionnum &= ~XFS_SB_VERSION_MOREBITSBIT;
}

/*
 * end of superblock version macros
 */
Loading