]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.suse/ocfs2-Add-the-inode64-mount-option.patch
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.suse / ocfs2-Add-the-inode64-mount-option.patch
1 From: Joel Becker <joel.becker@oracle.com>
2 Subject: ocfs2: Add the 'inode64' mount option.
3 Patch-mainline: 2.6.28?
4 References: FATE302877
5
6 Now that ocfs2 limits inode numbers to 32bits, add a mount option to
7 disable the limit. This parallels XFS. 64bit systems can handle the
8 larger inode numbers.
9
10 [ Added description of inode64 mount option in ocfs2.txt. --Mark ]
11
12 Signed-off-by: Joel Becker <joel.becker@oracle.com>
13 Signed-off-by: Mark Fasheh <mfasheh@suse.com>
14 ---
15 Documentation/filesystems/ocfs2.txt | 4 ++++
16 fs/ocfs2/ocfs2.h | 1 +
17 fs/ocfs2/suballoc.c | 5 +++--
18 fs/ocfs2/super.c | 17 +++++++++++++++++
19 4 files changed, 25 insertions(+), 2 deletions(-)
20
21 Index: linux-2.6.26/Documentation/filesystems/ocfs2.txt
22 ===================================================================
23 --- linux-2.6.26.orig/Documentation/filesystems/ocfs2.txt
24 +++ linux-2.6.26/Documentation/filesystems/ocfs2.txt
25 @@ -76,3 +76,7 @@ localalloc=8(*) Allows custom localallo
26 large, the fs will silently revert it to the default.
27 Localalloc is not enabled for local mounts.
28 localflocks This disables cluster aware flock.
29 +inode64 Indicates that Ocfs2 is allowed to create inodes at
30 + any location in the filesystem, including those which
31 + will result in inode numbers occupying more than 32
32 + bits of significance.
33 Index: linux-2.6.26/fs/ocfs2/ocfs2.h
34 ===================================================================
35 --- linux-2.6.26.orig/fs/ocfs2/ocfs2.h
36 +++ linux-2.6.26/fs/ocfs2/ocfs2.h
37 @@ -185,6 +185,7 @@ enum ocfs2_mount_options
38 OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */
39 OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */
40 OCFS2_MOUNT_NOUSERXATTR = 1 << 6, /* No user xattr */
41 + OCFS2_MOUNT_INODE64 = 1 << 7, /* Allow inode numbers > 2^32 */
42 };
43
44 #define OCFS2_OSB_SOFT_RO 0x0001
45 Index: linux-2.6.26/fs/ocfs2/suballoc.c
46 ===================================================================
47 --- linux-2.6.26.orig/fs/ocfs2/suballoc.c
48 +++ linux-2.6.26/fs/ocfs2/suballoc.c
49 @@ -601,9 +601,10 @@ int ocfs2_reserve_new_inode(struct ocfs2
50 /*
51 * stat(2) can't handle i_ino > 32bits, so we tell the
52 * lower levels not to allocate us a block group past that
53 - * limit.
54 + * limit. The 'inode64' mount option avoids this behavior.
55 */
56 - (*ac)->ac_max_block = (u32)~0U;
57 + if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64))
58 + (*ac)->ac_max_block = (u32)~0U;
59
60 /*
61 * slot is set when we successfully steal inode from other nodes.
62 Index: linux-2.6.26/fs/ocfs2/super.c
63 ===================================================================
64 --- linux-2.6.26.orig/fs/ocfs2/super.c
65 +++ linux-2.6.26/fs/ocfs2/super.c
66 @@ -157,6 +157,7 @@ enum {
67 Opt_stack,
68 Opt_user_xattr,
69 Opt_nouser_xattr,
70 + Opt_inode64,
71 Opt_err,
72 };
73
74 @@ -178,6 +179,7 @@ static match_table_t tokens = {
75 {Opt_stack, "cluster_stack=%s"},
76 {Opt_user_xattr, "user_xattr"},
77 {Opt_nouser_xattr, "nouser_xattr"},
78 + {Opt_inode64, "inode64"},
79 {Opt_err, NULL}
80 };
81
82 @@ -411,6 +413,15 @@ static int ocfs2_remount(struct super_bl
83 goto out;
84 }
85
86 + /* Probably don't want this on remount; it might
87 + * mess with other nodes */
88 + if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64) &&
89 + (parsed_options.mount_opt & OCFS2_MOUNT_INODE64)) {
90 + ret = -EINVAL;
91 + mlog(ML_ERROR, "Cannot enable inode64 on remount\n");
92 + goto out;
93 + }
94 +
95 /* We're going to/from readonly mode. */
96 if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY)) {
97 /* Lock here so the check of HARD_RO and the potential
98 @@ -929,6 +940,9 @@ static int ocfs2_parse_options(struct su
99 OCFS2_STACK_LABEL_LEN);
100 mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0';
101 break;
102 + case Opt_inode64:
103 + mopt->mount_opt |= OCFS2_MOUNT_INODE64;
104 + break;
105 default:
106 mlog(ML_ERROR,
107 "Unrecognized mount option \"%s\" "
108 @@ -996,6 +1010,9 @@ static int ocfs2_show_options(struct seq
109 else
110 seq_printf(s, ",user_xattr");
111
112 + if (opts & OCFS2_MOUNT_INODE64)
113 + seq_printf(s, ",inode64");
114 +
115 return 0;
116 }
117