aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/super.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2009-09-28 05:30:49 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2009-12-03 06:42:47 -0500
commitf55073ff1eaf99f6b3bc62134a456638bca043a3 (patch)
tree9637792f97494de2336f17a90a756e91c7d25527 /fs/gfs2/super.c
parent7e71c55ee73988d0cb61045660b899eaac23bf8f (diff)
GFS2: Fix -o meta mounts for subsequent mounts (i.e. all but the first one)
We have a long term plan to use the "-o meta" flag to GFS2 mounts to access the alternate root which is used to store metadata for a GFS2 filesystem. This will allow us to eventually remove support for the gfs2meta filesystem type (which is in any case just a "front end" to the gfs2 filesystem type with the meta/master root). Currently the "-o meta" option is only taken into account on the initial mount of the filesystem. Subsequent mounts of the same filesystem (i.e. on the same device) result in basically the same as bind mounting the root of the original mount. This patch changes that by using what is more or less a copy of get_sb_bdev() and extending it so that it will take into account the alternate root in all cases. The main difference is that we have to parse the mount options a bit earlier. We can then use them to select the appropriate root towards the end of the function. In addition this also fixes a bug where it was possible (but certainly not desirable) to set different ro/rw options for the meta root when mounted via the gfs2meta fs compared with the original mount. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: Alexander Viro <aviro@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r--fs/gfs2/super.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 0ec3ec672de1..42e5458703f0 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -106,13 +106,13 @@ static const match_table_t tokens = {
106 106
107/** 107/**
108 * gfs2_mount_args - Parse mount options 108 * gfs2_mount_args - Parse mount options
109 * @sdp: 109 * @args: The structure into which the parsed options will be written
110 * @data: 110 * @options: The options to parse
111 * 111 *
112 * Return: errno 112 * Return: errno
113 */ 113 */
114 114
115int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options) 115int gfs2_mount_args(struct gfs2_args *args, char *options)
116{ 116{
117 char *o; 117 char *o;
118 int token; 118 int token;
@@ -157,7 +157,7 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options)
157 break; 157 break;
158 case Opt_debug: 158 case Opt_debug:
159 if (args->ar_errors == GFS2_ERRORS_PANIC) { 159 if (args->ar_errors == GFS2_ERRORS_PANIC) {
160 fs_info(sdp, "-o debug and -o errors=panic " 160 printk(KERN_WARNING "GFS2: -o debug and -o errors=panic "
161 "are mutually exclusive.\n"); 161 "are mutually exclusive.\n");
162 return -EINVAL; 162 return -EINVAL;
163 } 163 }
@@ -210,7 +210,7 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options)
210 case Opt_commit: 210 case Opt_commit:
211 rv = match_int(&tmp[0], &args->ar_commit); 211 rv = match_int(&tmp[0], &args->ar_commit);
212 if (rv || args->ar_commit <= 0) { 212 if (rv || args->ar_commit <= 0) {
213 fs_info(sdp, "commit mount option requires a positive numeric argument\n"); 213 printk(KERN_WARNING "GFS2: commit mount option requires a positive numeric argument\n");
214 return rv ? rv : -EINVAL; 214 return rv ? rv : -EINVAL;
215 } 215 }
216 break; 216 break;
@@ -219,7 +219,7 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options)
219 break; 219 break;
220 case Opt_err_panic: 220 case Opt_err_panic:
221 if (args->ar_debug) { 221 if (args->ar_debug) {
222 fs_info(sdp, "-o debug and -o errors=panic " 222 printk(KERN_WARNING "GFS2: -o debug and -o errors=panic "
223 "are mutually exclusive.\n"); 223 "are mutually exclusive.\n");
224 return -EINVAL; 224 return -EINVAL;
225 } 225 }
@@ -227,7 +227,7 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options)
227 break; 227 break;
228 case Opt_error: 228 case Opt_error:
229 default: 229 default:
230 fs_info(sdp, "invalid mount option: %s\n", o); 230 printk(KERN_WARNING "GFS2: invalid mount option: %s\n", o);
231 return -EINVAL; 231 return -EINVAL;
232 } 232 }
233 } 233 }
@@ -1062,7 +1062,7 @@ static int gfs2_remount_fs(struct super_block *sb, int *flags, char *data)
1062 spin_lock(&gt->gt_spin); 1062 spin_lock(&gt->gt_spin);
1063 args.ar_commit = gt->gt_log_flush_secs; 1063 args.ar_commit = gt->gt_log_flush_secs;
1064 spin_unlock(&gt->gt_spin); 1064 spin_unlock(&gt->gt_spin);
1065 error = gfs2_mount_args(sdp, &args, data); 1065 error = gfs2_mount_args(&args, data);
1066 if (error) 1066 if (error)
1067 return error; 1067 return error;
1068 1068