All of lore.kernel.org
 help / color / mirror / Atom feed
* FUSE no longer allows empty string for "source" with new mount API
@ 2021-01-06 22:37 Spencer Baugh
  0 siblings, 0 replies; only message in thread
From: Spencer Baugh @ 2021-01-06 22:37 UTC (permalink / raw)
  To: David Howells, Miklos Szeredi; +Cc: inux-kernel, linux-fsdevel


Hi,

Calling mount(2) and passing an empty string for the "source" parameter
when mounting a FUSE filesystem used to work.

However, it seems after the migration to the new mount API, passing an
empty string for "source" with mount(2) no longer works, since the new
mount API actually parses the "source" parameter and doesn't allow an
empty string. This breaks users of FUSE which don't go through libfuse,
so it seems like a userspace-visible regression.

I haven't bisected to confirm that it's specifically the new mount API
which is the problem, just seen that it works on some old kernels and
fails on some kernels after

commit c30da2e981a703c6b1d49911511f7ade8dac20be
Author: David Howells <dhowells@redhat.com>
Date:   Mon Mar 25 16:38:31 2019 +0000

    fuse: convert to use the new mount API

so apologies if the culprit turns out to be something else.

I'd try to fix it myself, but I'm not sure how to completely ignore a
parameter with the new mount API - I assume that with the new mount API,
we need to explicitly handle "source", so something like the below
simple patch won't work.

Thanks,
Spencer Baugh

---
1 file changed, 8 deletions(-)
fs/fuse/inode.c | 8 --------

modified   fs/fuse/inode.c
@@ -449,7 +449,6 @@ enum {
 };
 
 static const struct fs_parameter_spec fuse_fs_parameters[] = {
-	fsparam_string	("source",		OPT_SOURCE),
 	fsparam_u32	("fd",			OPT_FD),
 	fsparam_u32oct	("rootmode",		OPT_ROOTMODE),
 	fsparam_u32	("user_id",		OPT_USER_ID),
@@ -473,13 +472,6 @@ static int fuse_parse_param(struct fs_context *fc, struct fs_parameter *param)
 		return opt;
 
 	switch (opt) {
-	case OPT_SOURCE:
-		if (fc->source)
-			return invalfc(fc, "Multiple sources specified");
-		fc->source = param->string;
-		param->string = NULL;
-		break;
-
 	case OPT_SUBTYPE:
 		if (ctx->subtype)
 			return invalfc(fc, "Multiple subtypes specified");


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-06 22:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06 22:37 FUSE no longer allows empty string for "source" with new mount API Spencer Baugh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.