Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99663be7 authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by Linus Torvalds
Browse files

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: default avatarVasiliy Kulikov <segoon@openwall.com>
Reported-by: default avatarArkadiusz Miskiewicz <a.miskiewicz@gmail.com>
Tested-by: default avatarArkadiusz 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 10bdfb5e
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -115,12 +115,13 @@ static struct dentry *proc_mount(struct file_system_type *fs_type,
	if (IS_ERR(sb))
		return ERR_CAST(sb);

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

	if (!sb->s_root) {
		sb->s_flags = flags;
		err = proc_fill_super(sb);
		if (err) {
			deactivate_locked_super(sb);