Skip to contentSkip to conversation

xfs: minor inode64 mount option cleanup

PATCH In review Alex Elder 2 participants 2 messages Aug 1, 2012 – Aug 17, 2012 XFS filesystem

lore
Share & tools
lore

Alex Elder

author
#0 lore raw

PATCH 1/1 xfs: minor inode64 mount option cleanup

Supplying the "inode64" mount option means inode allocations should not be restricted to "small" inode numbers (within a 32 bit range). So in xfs_parseargs(), the XFS_MOUNT_SMALL_INUMS flag is cleared if "inode64" is requested.

If a kernel does not support 64-bit inodes (which may be because it doesn't support 64-bit block addresses), the "inode64" mount option is not allowed. But even though it's treated as an invalid mount option xfs_parseargs() still clears SMALL_INUMS flag if "inode64" is requested.

The end result may not actually matter, but I think we should not be changing any state (clearing the SMALL_INUMS flag) when an invalid mount option is supplied.

So this just makes sure the SMALL_INUMS flag is only cleared if the kernel supports big inode numbers.

---
 fs/xfs/xfs_super.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/xfs/xfs_super.c +3 -2
Index: b/fs/xfs/xfs_super.c
===================================================================
@@ -295,12 +295,13 @@ xfs_parseargs(
 			}
 			dswidth = simple_strtoul(value, &eov, 10);
 		} else if (!strcmp(this_char, MNTOPT_64BITINODE)) {
+#if XFS_BIG_INUMS
 			mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS;
-#if !XFS_BIG_INUMS
+#else /* !XFS_BIG_INUMS */
 			xfs_warn(mp, "%s option not allowed on this system",
 				this_char);
 			return EINVAL;
-#endif
+#endif /* !XFS_BIG_INUMS */
 		} else if (!strcmp(this_char, MNTOPT_NOUUID)) {
 			mp->m_flags |= XFS_MOUNT_NOUUID;
 		} else if (!strcmp(this_char, MNTOPT_BARRIER)) {

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

fs/xfs/xfs_super.c xfs_parseargs( · line 300

Quoted 8 lines
fs/xfs/xfs_super.c +2 -1
@@ -295,12 +295,13 @@ xfs_parseargs(
 			}
 			dswidth = simple_strtoul(value, &eov, 10);
 		} else if (!strcmp(this_char, MNTOPT_64BITINODE)) {
+#if XFS_BIG_INUMS
 			mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS;
-#if !XFS_BIG_INUMS
+#else /* !XFS_BIG_INUMS */

Looks good for now, but in the long run I'd prefer thast XFS simplify requires 64-bit block numbers like gfs2 as there's not too much of a point using it in a super-constrained envrionment and we could kill all the XFS_BIG_INUMS conditionals, as well as the types that are different based on the in-memory block number size.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs