Re: [PATCH 01/33] misc: adapt tests to handle the fuse ext[234] drivers

Amir Goldstein
2025-11-06T08:58:41Z

On Wed, Nov 5, 2025 at 11:53 PM Darrick J. Wong <djwong@kernel.org> wrote:
>
> On Thu, Oct 30, 2025 at 10:51:06AM +0100, Amir Goldstein wrote:
> > On Wed, Oct 29, 2025 at 2:22 AM Darrick J. Wong <djwong@kernel.org> wrote:
> > >
> > > From: Darrick J. Wong <djwong@kernel.org>
> > >
> > > It would be useful to be able to run fstests against the userspace
> > > ext[234] driver program fuse2fs. A convention (at least on Debian)
> > > seems to be to install fuse drivers as /sbin/mount.fuse.XXX so that
> > > users can run "mount -t fuse.XXX" to start a fuse driver for a
> > > disk-based filesystem type XXX.
> > >
> > > Therefore, we'll adopt the practice of setting FSTYP=fuse.ext4 to
> > > test ext4 with fuse2fs. Change all the library code as needed to handle
> > > this new type alongside all the existing ext[234] checks, which seems a
> > > little cleaner than FSTYP=fuse FUSE_SUBTYPE=ext4, which also would
> > > require even more treewide cleanups to work properly because most
> > > fstests code switches on $FSTYP alone.
> > >
> >
> > I agree that FSTYP=fuse.ext4 is cleaner than
> > FSTYP=fuse FUSE_SUBTYPE=ext4
> > but it is not extendable to future (e.g. fuse.xfs)
> > and it is still a bit ugly.
> >
> > Consider:
> > FSTYP=fuse.ext4
> > MKFSTYP=ext4
> >
> > I think this is the correct abstraction -
> > fuse2fs/ext4 are formatted that same and mounted differently
> >
> > See how some of your patch looks nicer and naturally extends to
> > the imaginary fuse.xfs...
>
> Maybe I'd rather do it the other way around for fuse4fs:
>
> FSTYP=ext4
> MOUNT_FSTYP=fuse.ext4
>

Sounds good. Will need to see the final patch.

> (obviously, MOUNT_FSTYP=$FSTYP if the test runner hasn't overridden it)
>
> Where $MOUNT_FSTYP is what you pass to mount -t and what you'd see in
> /proc/mounts. The only weirdness with that is that some of the helpers
> will end up with code like:
>
> case $FSTYP in
> ext4)
> # do ext4 stuff
> ;;
> esac
>
> case $MOUNT_FSTYP in
> fuse.ext4)
> # do fuse4fs stuff that overrides ext4
> ;;
> esac
>
> which would be a little weird.
>

Sounds weird, but there is always going to be weirdness
somewhere - need to pick the least weird result or most
easy to understand code IMO.

> _scratch_mount would end up with:
>
> $MOUNT_PROG -t $MOUNT_FSTYP ...
>
> and detecting it would be
>
> grep -q -w $MOUNT_FSTYP /proc/mounts || _fail "booooo"
>
> Hrm?

Those look obviously nice.

Maybe the answer is to have all MOUNT_FSTYP, MKFS_FSTYP
and FSTYP and use whichever best fits in the context.

Thanks,
Amir.