aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasiliy Kulikov <segoon@openwall.com>2012-04-05 17:25:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-05 18:25:50 -0400
commit99663be772c827b8f5f594fe87eb4807be1994e5 (patch)
treef1adffce3f6d10a90f5be8b86b96729ce8c5d23c
parent10bdfb5ef7e1a429a3de31e498942a8ae5749a46 (diff)
proc: fix mount -t proc -o AAA
The proc_parse_options() call from proc_mount() runs only once at boot time. So on any later mount attempt, any mount options are ignored because ->s_root is already initialized. As a consequence, "mount -o <options>" will ignore the options. The only way to change mount options is "mount -o remount,<options>". To fix this, parse the mount options unconditionally. Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Reported-by: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com> Tested-by: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/proc/root.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/proc/root.c b/fs/proc/root.c
index 46a15d8a29ca..eed44bfc85db 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -115,12 +115,13 @@ static struct dentry *proc_mount(struct file_system_type *fs_type,
115 if (IS_ERR(sb)) 115 if (IS_ERR(sb))
116 return ERR_CAST(sb); 116 return ERR_CAST(sb);
117 117
118 if (!proc_parse_options(options, ns)) {
119 deactivate_locked_super(sb);
120 return ERR_PTR(-EINVAL);
121 }
122
118 if (!sb->s_root) { 123 if (!sb->s_root) {
119 sb->s_flags = flags; 124 sb->s_flags = flags;
120 if (!proc_parse_options(options, ns)) {
121 deactivate_locked_super(sb);
122 return ERR_PTR(-EINVAL);
123 }
124 err = proc_fill_super(sb); 125 err = proc_fill_super(sb);
125 if (err) { 126 if (err) {
126 deactivate_locked_super(sb); 127 deactivate_locked_super(sb);