diff mbox series

cifs: ignore the noauto option if it is provided

Message ID 20210127071020.18052-1-adam@adamharvey.name (mailing list archive)
State New, archived
Headers show
Series cifs: ignore the noauto option if it is provided | expand

Commit Message

Adam Harvey Jan. 27, 2021, 7:10 a.m. UTC
In 24e0a1eff9e2, the noauto option was missed when migrating to the new
mount API. As a result, users with noauto in their fstab mount options
are now unable to mount cifs filesystems, as they'll receive an "Unknown
parameter" error.

This restores the old behaviour of ignoring noauto if it's given.

Fixes: 24e0a1eff9e2 ("cifs: switch to new mount api")
Signed-off-by: Adam Harvey <adam@adamharvey.name>
---
 fs/cifs/fs_context.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Aurélien Aptel Jan. 27, 2021, 10:56 a.m. UTC | #1
Hi Adam,

Adam Harvey <adam@adamharvey.name> writes:
> In 24e0a1eff9e2, the noauto option was missed when migrating to the new
> mount API. As a result, users with noauto in their fstab mount options
> are now unable to mount cifs filesystems, as they'll receive an "Unknown
> parameter" error.
>
> This restores the old behaviour of ignoring noauto if it's given.

I was looking at other fs code and it seems no one explicitely parses
auto/noauto. Any idea why? This looks like it could be handled somewhere
else.

Also I would have expected fsparam_flag_no("auto", Opt_ignore) to allow
for both auto and noauto.

Cheers,
Adam Harvey Jan. 27, 2021, 8:39 p.m. UTC | #2
On Wed, 27 Jan 2021 at 02:56, Aurélien Aptel <aaptel@suse.com> wrote:
>
> Hi Adam,
>
> Adam Harvey <adam@adamharvey.name> writes:
> > In 24e0a1eff9e2, the noauto option was missed when migrating to the new
> > mount API. As a result, users with noauto in their fstab mount options
> > are now unable to mount cifs filesystems, as they'll receive an "Unknown
> > parameter" error.
> >
> > This restores the old behaviour of ignoring noauto if it's given.
>
> I was looking at other fs code and it seems no one explicitely parses
> auto/noauto. Any idea why? This looks like it could be handled somewhere
> else.

Honestly, I have no idea. I'm just a regular user trying to get his
music share to mount on 5.11-rc5. :)

> Also I would have expected fsparam_flag_no("auto", Opt_ignore) to allow
> for both auto and noauto.

Good catch! I misread the fstab manpage last night and thought there
wasn't a matching "auto". I'll send an updated patch that supports
both.

Thanks,

Adam
Adam Harvey Jan. 27, 2021, 8:43 p.m. UTC | #3
On Wed, 27 Jan 2021 at 12:06, Steve French <smfrench@gmail.com> wrote:
> I didn't see anything logged in dmesg (when I tried it on 5.11-rc today) indicating it was a problem (it still tried the mount).Maybe it is stripped out by user space?

I did get a dmesg message when I tried it on 5.11.0-rc5. Here's my setup:

In /etc/fstab:

//10.42.84.1/shared /external cifs
noauto,user,rw,guest,uid=1000,gid=1000,vers=1.0 0 0

When I /mount external (with cifs-utils 6.11 installed, should that
matter), I get this in dmesg:

Jan 26 21:11:17 nosecam kernel: cifs: Unknown parameter 'noauto'

And the mount fails.

Adam
diff mbox series

Patch

diff --git a/fs/cifs/fs_context.c b/fs/cifs/fs_context.c
index 076bcadc756a..0edde5c66985 100644
--- a/fs/cifs/fs_context.c
+++ b/fs/cifs/fs_context.c
@@ -171,6 +171,7 @@  const struct fs_parameter_spec smb3_fs_parameters[] = {
 	fsparam_flag("noatime", Opt_ignore),
 	fsparam_flag("relatime", Opt_ignore),
 	fsparam_flag("_netdev", Opt_ignore),
+	fsparam_flag("noauto", Opt_ignore),
 	fsparam_flag_no("suid", Opt_ignore),
 	fsparam_flag_no("exec", Opt_ignore),
 	fsparam_flag_no("dev", Opt_ignore),