From 609e1b018d91990a12fd2921453bfec2d4490383 Mon Sep 17 00:00:00 2001 From: Joel Becker Date: Wed, 3 Sep 2008 20:03:40 -0700 Subject: [PATCH] --- yaml --- r: 114399 b: refs/heads/master c: 12462f1d9f0b96389497438dc2730c6f7410be82 h: refs/heads/master i: 114397: dc72f628928f16735caa496de80828ad9598cf83 114395: eb87759681ab47c89c91aa4d2723a2afb757fb62 114391: 450bd970e73a47d74c4ddc9405f1bfac40db8cd1 114383: c8767a733b852afa2f5d48a662485c8994b5656f 114367: 92a28dee7c8a57d5659903850f44f34c5a0e8c2c v: v3 --- [refs] | 2 +- trunk/Documentation/filesystems/ocfs2.txt | 4 ++++ trunk/fs/ocfs2/ocfs2.h | 1 + trunk/fs/ocfs2/suballoc.c | 5 +++-- trunk/fs/ocfs2/super.c | 17 +++++++++++++++++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index a5239855483c..f8c6d1f4f835 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1187c968852e3c668f3b9376083851f81f6eee22 +refs/heads/master: 12462f1d9f0b96389497438dc2730c6f7410be82 diff --git a/trunk/Documentation/filesystems/ocfs2.txt b/trunk/Documentation/filesystems/ocfs2.txt index c318a8bbb1ef..6acf1b4f2466 100644 --- a/trunk/Documentation/filesystems/ocfs2.txt +++ b/trunk/Documentation/filesystems/ocfs2.txt @@ -76,3 +76,7 @@ localalloc=8(*) Allows custom localalloc size in MB. If the value is too large, the fs will silently revert it to the default. Localalloc is not enabled for local mounts. localflocks This disables cluster aware flock. +inode64 Indicates that Ocfs2 is allowed to create inodes at + any location in the filesystem, including those which + will result in inode numbers occupying more than 32 + bits of significance. diff --git a/trunk/fs/ocfs2/ocfs2.h b/trunk/fs/ocfs2/ocfs2.h index 6d3c10ddf489..78ae4f87e6b0 100644 --- a/trunk/fs/ocfs2/ocfs2.h +++ b/trunk/fs/ocfs2/ocfs2.h @@ -189,6 +189,7 @@ enum ocfs2_mount_options OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */ OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */ OCFS2_MOUNT_NOUSERXATTR = 1 << 6, /* No user xattr */ + OCFS2_MOUNT_INODE64 = 1 << 7, /* Allow inode numbers > 2^32 */ }; #define OCFS2_OSB_SOFT_RO 0x0001 diff --git a/trunk/fs/ocfs2/suballoc.c b/trunk/fs/ocfs2/suballoc.c index 213bdca16fe4..d7a6f928c317 100644 --- a/trunk/fs/ocfs2/suballoc.c +++ b/trunk/fs/ocfs2/suballoc.c @@ -601,9 +601,10 @@ int ocfs2_reserve_new_inode(struct ocfs2_super *osb, /* * stat(2) can't handle i_ino > 32bits, so we tell the * lower levels not to allocate us a block group past that - * limit. + * limit. The 'inode64' mount option avoids this behavior. */ - (*ac)->ac_max_block = (u32)~0U; + if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64)) + (*ac)->ac_max_block = (u32)~0U; /* * slot is set when we successfully steal inode from other nodes. diff --git a/trunk/fs/ocfs2/super.c b/trunk/fs/ocfs2/super.c index c85e525950a9..1a51c8c53bef 100644 --- a/trunk/fs/ocfs2/super.c +++ b/trunk/fs/ocfs2/super.c @@ -157,6 +157,7 @@ enum { Opt_stack, Opt_user_xattr, Opt_nouser_xattr, + Opt_inode64, Opt_err, }; @@ -178,6 +179,7 @@ static const match_table_t tokens = { {Opt_stack, "cluster_stack=%s"}, {Opt_user_xattr, "user_xattr"}, {Opt_nouser_xattr, "nouser_xattr"}, + {Opt_inode64, "inode64"}, {Opt_err, NULL} }; @@ -411,6 +413,15 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data) goto out; } + /* Probably don't want this on remount; it might + * mess with other nodes */ + if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64) && + (parsed_options.mount_opt & OCFS2_MOUNT_INODE64)) { + ret = -EINVAL; + mlog(ML_ERROR, "Cannot enable inode64 on remount\n"); + goto out; + } + /* We're going to/from readonly mode. */ if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY)) { /* Lock here so the check of HARD_RO and the potential @@ -930,6 +941,9 @@ static int ocfs2_parse_options(struct super_block *sb, OCFS2_STACK_LABEL_LEN); mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0'; break; + case Opt_inode64: + mopt->mount_opt |= OCFS2_MOUNT_INODE64; + break; default: mlog(ML_ERROR, "Unrecognized mount option \"%s\" " @@ -994,6 +1008,9 @@ static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt) seq_printf(s, ",cluster_stack=%.*s", OCFS2_STACK_LABEL_LEN, osb->osb_cluster_stack); + if (opts & OCFS2_MOUNT_INODE64) + seq_printf(s, ",inode64"); + return 0; }