aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTim Shimmin <tes@sgi.com>2008-04-30 04:15:28 -0400
committerNiv Sardi <xaiki@debian.org>2008-07-28 02:58:05 -0400
commit7c12f296500e1157872ef45b3f3bb06b4b73f1c1 (patch)
treed6737b8ee2775ff70a1a7b5c77a4c25b3423bada /fs
parentf9f6dce01905179d9a209cc1e69fe9047736c112 (diff)
[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: Tim Shimmin <tes@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c1
-rw-r--r--fs/xfs/xfs_clnt.h1
-rw-r--r--fs/xfs/xfs_mount.c12
-rw-r--r--fs/xfs/xfs_mount.h1
-rw-r--r--fs/xfs/xfs_sb.h7
-rw-r--r--fs/xfs/xfs_vfsops.c9
6 files changed, 29 insertions, 2 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 943381284e2e..1b60e46f527f 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -314,6 +314,7 @@ xfs_parseargs(
314 args->flags |= XFSMNT_ATTR2; 314 args->flags |= XFSMNT_ATTR2;
315 } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { 315 } else if (!strcmp(this_char, MNTOPT_NOATTR2)) {
316 args->flags &= ~XFSMNT_ATTR2; 316 args->flags &= ~XFSMNT_ATTR2;
317 args->flags |= XFSMNT_NOATTR2;
317 } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { 318 } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) {
318 args->flags2 |= XFSMNT2_FILESTREAMS; 319 args->flags2 |= XFSMNT2_FILESTREAMS;
319 } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { 320 } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) {
diff --git a/fs/xfs/xfs_clnt.h b/fs/xfs/xfs_clnt.h
index d5d1e60ee224..d2ce5dd70d87 100644
--- a/fs/xfs/xfs_clnt.h
+++ b/fs/xfs/xfs_clnt.h
@@ -78,6 +78,7 @@ struct xfs_mount_args {
78#define XFSMNT_IOSIZE 0x00002000 /* optimize for I/O size */ 78#define XFSMNT_IOSIZE 0x00002000 /* optimize for I/O size */
79#define XFSMNT_OSYNCISOSYNC 0x00004000 /* o_sync is REALLY o_sync */ 79#define XFSMNT_OSYNCISOSYNC 0x00004000 /* o_sync is REALLY o_sync */
80 /* (osyncisdsync is default) */ 80 /* (osyncisdsync is default) */
81#define XFSMNT_NOATTR2 0x00008000 /* turn off ATTR2 EA format */
81#define XFSMNT_32BITINODES 0x00200000 /* restrict inodes to 32 82#define XFSMNT_32BITINODES 0x00200000 /* restrict inodes to 32
82 * bits of address space */ 83 * bits of address space */
83#define XFSMNT_GQUOTA 0x00400000 /* group quota accounting */ 84#define XFSMNT_GQUOTA 0x00400000 /* group quota accounting */
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index da3988453b71..361c7a755a07 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -994,9 +994,19 @@ xfs_mountfs(
994 * Re-check for ATTR2 in case it was found in bad_features2 994 * Re-check for ATTR2 in case it was found in bad_features2
995 * slot. 995 * slot.
996 */ 996 */
997 if (xfs_sb_version_hasattr2(&mp->m_sb)) 997 if (xfs_sb_version_hasattr2(&mp->m_sb) &&
998 !(mp->m_flags & XFS_MOUNT_NOATTR2))
998 mp->m_flags |= XFS_MOUNT_ATTR2; 999 mp->m_flags |= XFS_MOUNT_ATTR2;
1000 }
1001
1002 if (xfs_sb_version_hasattr2(&mp->m_sb) &&
1003 (mp->m_flags & XFS_MOUNT_NOATTR2)) {
1004 xfs_sb_version_removeattr2(&mp->m_sb);
1005 update_flags |= XFS_SB_FEATURES2;
999 1006
1007 /* update sb_versionnum for the clearing of the morebits */
1008 if (!sbp->sb_features2)
1009 update_flags |= XFS_SB_VERSIONNUM;
1000 } 1010 }
1001 1011
1002 /* 1012 /*
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 63e0693a358a..4aff0c125ad3 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -378,6 +378,7 @@ typedef struct xfs_mount {
378 counters */ 378 counters */
379#define XFS_MOUNT_FILESTREAMS (1ULL << 24) /* enable the filestreams 379#define XFS_MOUNT_FILESTREAMS (1ULL << 24) /* enable the filestreams
380 allocator */ 380 allocator */
381#define XFS_MOUNT_NOATTR2 (1ULL << 25) /* disable use of attr2 format */
381 382
382 383
383/* 384/*
diff --git a/fs/xfs/xfs_sb.h b/fs/xfs/xfs_sb.h
index d904efe7f871..e3204a36a222 100644
--- a/fs/xfs/xfs_sb.h
+++ b/fs/xfs/xfs_sb.h
@@ -473,6 +473,13 @@ static inline void xfs_sb_version_addattr2(xfs_sb_t *sbp)
473 ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT))); 473 ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT)));
474} 474}
475 475
476static inline void xfs_sb_version_removeattr2(xfs_sb_t *sbp)
477{
478 sbp->sb_features2 &= ~XFS_SB_VERSION2_ATTR2BIT;
479 if (!sbp->sb_features2)
480 sbp->sb_versionnum &= ~XFS_SB_VERSION_MOREBITSBIT;
481}
482
476/* 483/*
477 * end of superblock version macros 484 * end of superblock version macros
478 */ 485 */
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index 30bacd8bb0e5..bbc911720d81 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -284,6 +284,8 @@ xfs_start_flags(
284 mp->m_flags |= XFS_MOUNT_DIRSYNC; 284 mp->m_flags |= XFS_MOUNT_DIRSYNC;
285 if (ap->flags & XFSMNT_ATTR2) 285 if (ap->flags & XFSMNT_ATTR2)
286 mp->m_flags |= XFS_MOUNT_ATTR2; 286 mp->m_flags |= XFS_MOUNT_ATTR2;
287 if (ap->flags & XFSMNT_NOATTR2)
288 mp->m_flags |= XFS_MOUNT_NOATTR2;
287 289
288 if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE) 290 if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE)
289 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; 291 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE;
@@ -346,7 +348,12 @@ xfs_finish_flags(
346 } 348 }
347 } 349 }
348 350
349 if (xfs_sb_version_hasattr2(&mp->m_sb)) 351 /*
352 * mkfs'ed attr2 will turn on attr2 mount unless explicitly
353 * told by noattr2 to turn it off
354 */
355 if (xfs_sb_version_hasattr2(&mp->m_sb) &&
356 !(ap->flags & XFSMNT_NOATTR2))
350 mp->m_flags |= XFS_MOUNT_ATTR2; 357 mp->m_flags |= XFS_MOUNT_ATTR2;
351 358
352 /* 359 /*