Skip to content

Commit

Permalink
proc: fix mount -t proc -o AAA
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Arkadiusz Miskiewicz <[email protected]>
Tested-by: Arkadiusz Miskiewicz <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Valdis Kletnieks <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
segoon authored and torvalds committed Apr 5, 2012
1 parent 10bdfb5 commit 99663be
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fs/proc/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,13 @@ static struct dentry *proc_mount(struct file_system_type *fs_type,
if (IS_ERR(sb))
return ERR_CAST(sb);

if (!proc_parse_options(options, ns)) {
deactivate_locked_super(sb);
return ERR_PTR(-EINVAL);
}

if (!sb->s_root) {
sb->s_flags = flags;
if (!proc_parse_options(options, ns)) {
deactivate_locked_super(sb);
return ERR_PTR(-EINVAL);
}
err = proc_fill_super(sb);
if (err) {
deactivate_locked_super(sb);
Expand Down

0 comments on commit 99663be

Please sign in to comment.