Linux filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Bernd Schubert <bernd@bsbernd.com>
Cc: joannelkoong@gmail.com, neal@gompa.dev,
	fuse-devel@lists.linux.dev, linux-fsdevel@vger.kernel.org,
	miklos@szeredi.hu
Subject: Re: [PATCH 2/2] libfuse: always send the subtype to the kernel when using fsconfig()
Date: Tue, 5 May 2026 09:38:23 -0700	[thread overview]
Message-ID: <20260505163823.GB7739@frogsfrogsfrogs> (raw)
In-Reply-To: <3b37a5be-c3c8-461d-8382-04ae86de81cc@bsbernd.com>

On Tue, May 05, 2026 at 09:41:59AM +0200, Bernd Schubert wrote:
> 
> 
> On 5/5/26 07:23, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Although it's possible to supply a filesystem subtype when calling
> > fsopen(), it does not pass the stuff after the dot to the mount option
> > parsing mechanism like the legacy mount() call does.  Therefore, it's
> > necessary to pass the subtype explicitly via fsconfig() or else the
> > subtype will be missing from the /proc/mounts output.
> > 
> > For example, fuse4fs with the old mount API produces this:
> > 
> > /dev/sda /mnt fuse.ext4 rw,nosuid,nodev,relatime,user_id=0,group_id=0 0 0
> > 
> > But with the new mount API, we only get:
> > 
> > /dev/sda /mnt fuse rw,nosuid,nodev,relatime,user_id=0,group_id=0 0 0
> > 
> > ...which breaks fstests, which requires the fsname to match the string
> > that it passes to mount -t.  Update the comment in mount_service.c to
> > match this requirement.
> > 
> > Fixes: 14cb7b93bb9688 ("Add support for the new linux mount API")
> > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > ---
> >  lib/mount_fsmount.c  |   13 +++++++++++++
> >  util/mount_service.c |    3 ++-
> >  2 files changed, 15 insertions(+), 1 deletion(-)
> > 
> > 
> > diff --git a/lib/mount_fsmount.c b/lib/mount_fsmount.c
> > index 615271b09758c3..5e13b34ccfc610 100644
> > --- a/lib/mount_fsmount.c
> > +++ b/lib/mount_fsmount.c
> > @@ -359,6 +359,19 @@ int fuse_kern_fsmount(const char *mnt, unsigned long flags, int blkdev,
> >  		goto out_free;
> >  	}
> >  
> > +	/* Configure subtype */
> > +	if (subtype) {
> > +		res = fsconfig(fsfd, FSCONFIG_SET_STRING, "subtype",
> > +			       subtype, 0);
> > +		if (res) {
> > +			err = -errno;
> > +			log_fsconfig_kmsg(fsfd);
> > +			fprintf(stderr, "fuse: fsconfig subtype failed: %s\n",
> > +				strerror(-err));
> > +			goto out_free;
> > +		}
> > +	}
> > +
> >  	/* Configure source */
> >  	res = fsconfig(fsfd, FSCONFIG_SET_STRING, "source", source, 0);
> >  	if (res == -1) {
> 
> Oh yes, that had slipped through. Going to apply this.

Thanks!

> > diff --git a/util/mount_service.c b/util/mount_service.c
> > index bc5940bc900dad..3fbabfdd69300d 100644
> > --- a/util/mount_service.c
> > +++ b/util/mount_service.c
> > @@ -821,7 +821,8 @@ static void try_fsopen(struct mount_service *mo)
> >  	/*
> >  	 * As of Linux 7.0 you can pass subtypes to fsopen, but the manpage for
> >  	 * fsopen only says that you can pass any value of the second column of
> > -	 * /proc/filesystems into fsopen.
> > +	 * /proc/filesystems into fsopen.  You must still call fsconfig() for
> > +	 * the subtype separately, however.
> >  	 */
> >  	mo->fsopenfd = fsopen(fsname(mo), FSOPEN_CLOEXEC);
> >  }
> > 
> 
> Can we integrate that into you series separately, as it is not merged yet?

I'll separate this hunk into a separate patch.

--D

> 
> Thanks,
> Bernd
> 

  reply	other threads:[~2026-05-05 16:38 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  5:21 [PATCHBOMB] libfuse: various fixes for new mount code Darrick J. Wong
2026-05-05  5:23 ` [PATCHSET 1/2] libfuse: new mount API and SYNC_INIT fixes Darrick J. Wong
2026-05-05  5:23   ` [PATCH 1/2] libfuse: don't use SYNC_INIT unless asked for Darrick J. Wong
2026-05-05  7:30     ` Bernd Schubert
2026-05-05  8:17       ` Bernd Schubert
2026-05-05 16:27         ` Darrick J. Wong
2026-05-05 16:44     ` [PATCH v1.1 " Darrick J. Wong
2026-05-05 20:02       ` Bernd Schubert
2026-05-05 22:08         ` Darrick J. Wong
2026-05-05 22:29           ` Bernd Schubert
2026-05-05 23:03             ` Darrick J. Wong
2026-05-05 23:10     ` [PATCH v1.2 " Darrick J. Wong
2026-05-05  5:23   ` [PATCH 2/2] libfuse: always send the subtype to the kernel when using fsconfig() Darrick J. Wong
2026-05-05  7:41     ` Bernd Schubert
2026-05-05 16:38       ` Darrick J. Wong [this message]
2026-05-05 23:09   ` [PATCH 3/2] mount_util: fix mount_flags entries for MS_RDONLY Darrick J. Wong
2026-05-05  5:23 ` [PATCHSET 2/2] libfuse: new mount service container fixes Darrick J. Wong
2026-05-05  5:24   ` [PATCH 01/10] util/mount.fuse.c: loop in waitpid Darrick J. Wong
2026-05-05  5:24   ` [PATCH 02/10] fuse_service: handle weird behavior during SCM_RIGHTS fd transfers Darrick J. Wong
2026-05-05  5:24   ` [PATCH 03/10] examples: improve documentation of the new systemd service fuse servers Darrick J. Wong
2026-05-05  5:24   ` [PATCH 04/10] example/single_file: sync backing fd when statx wants us to fsync Darrick J. Wong
2026-05-05  5:25   ` [PATCH 05/10] example/single_file: fix ctime handling Darrick J. Wong
2026-05-05  5:25   ` [PATCH 06/10] libfuse: fix cppcheck complaints about constifying pointers Darrick J. Wong
2026-05-05  5:25   ` [PATCH 07/10] libfuse: fix cppcheck complaints about constifying pointers in user-visible ABI Darrick J. Wong
2026-05-05  5:25   ` [PATCH 08/10] util: fix cppcheck complaints about constifying pointers Darrick J. Wong
2026-05-05  5:26   ` [PATCH 09/10] fuser_conf: fix cppcheck complaints Darrick J. Wong
2026-05-05  5:26   ` [PATCH 10/10] example: fix cppcheck complaints about constifying pointers Darrick J. Wong
2026-05-06 21:27   ` [PATCHSET 2/2] libfuse: new mount service container fixes Bernd Schubert
2026-05-06 21:36     ` Bernd Schubert
2026-05-05  5:26 ` [GIT PULL 1/2] libfuse: new mount API and SYNC_INIT fixes Darrick J. Wong
2026-05-05  5:26 ` [GIT PULL 2/2] libfuse: new mount service container fixes Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260505163823.GB7739@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=bernd@bsbernd.com \
    --cc=fuse-devel@lists.linux.dev \
    --cc=joannelkoong@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=neal@gompa.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox