From: "Darrick J. Wong" <djwong@kernel.org>
To: Amir Goldstein <amir73il@gmail.com>
Cc: zlang@redhat.com, neal@gompa.dev, fstests@vger.kernel.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
joannelkoong@gmail.com, bernd@bsbernd.com
Subject: Re: [PATCH 01/33] misc: adapt tests to handle the fuse ext[234] drivers
Date: Wed, 5 Nov 2025 14:53:55 -0800 [thread overview]
Message-ID: <20251105225355.GC196358@frogsfrogsfrogs> (raw)
In-Reply-To: <CAOQ4uxj7yaX5qLEs4BOJBJwybkHzv8WmNsUt0w_zehueOLLP9A@mail.gmail.com>
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
(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.
_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?
--D
>
> > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > ---
> > check | 24 +++++++++++++++++-------
> > common/casefold | 4 ++++
> > common/config | 11 ++++++++---
> > common/defrag | 2 +-
> > common/encrypt | 16 ++++++++--------
> > common/log | 10 +++++-----
> > common/populate | 14 +++++++-------
> > common/quota | 9 +++++++++
> > common/rc | 50 +++++++++++++++++++++++++++++---------------------
> > common/report | 2 +-
> > common/verity | 8 ++++----
> > tests/generic/020 | 2 +-
> > tests/generic/067 | 2 +-
> > tests/generic/441 | 2 +-
> > tests/generic/496 | 2 +-
> > tests/generic/621 | 2 +-
> > tests/generic/740 | 2 +-
> > tests/generic/746 | 4 ++--
> > tests/generic/765 | 4 ++--
> > 19 files changed, 103 insertions(+), 67 deletions(-)
> >
> >
> > diff --git a/check b/check
> > index 9bb80a22440f97..81cd03f73ce155 100755
> > --- a/check
> > +++ b/check
> > @@ -140,12 +140,25 @@ get_sub_group_list()
> > echo $grpl
> > }
> >
> > +get_group_dirs()
> > +{
> > + local fsgroup="$FSTYP"
> > +
> > + case "$FSTYP" in
> > + ext2|ext3|fuse.ext[234])
> > + fsgroup=ext4
> > + ;;
> > + esac
> > +
> > + echo $SRC_GROUPS
> > + echo $fsgroup
> > +}
> > +
> > get_group_list()
> > {
> > local grp=$1
> > local grpl=""
> > local sub=$(dirname $grp)
> > - local fsgroup="$FSTYP"
> >
> > if [ -n "$sub" -a "$sub" != "." -a -d "$SRC_DIR/$sub" ]; then
> > # group is given as <subdir>/<group> (e.g. xfs/quick)
> > @@ -154,10 +167,7 @@ get_group_list()
> > return
> > fi
> >
> > - if [ "$FSTYP" = ext2 -o "$FSTYP" = ext3 ]; then
> > - fsgroup=ext4
> > - fi
> > - for d in $SRC_GROUPS $fsgroup; do
> > + for d in $(get_group_dirs); do
> > if ! test -d "$SRC_DIR/$d" ; then
> > continue
> > fi
> > @@ -171,7 +181,7 @@ get_group_list()
> > get_all_tests()
> > {
> > touch $tmp.list
> > - for d in $SRC_GROUPS $FSTYP; do
> > + for d in $(get_group_dirs); do
> > if ! test -d "$SRC_DIR/$d" ; then
> > continue
> > fi
> > @@ -387,7 +397,7 @@ if [ -n "$FUZZ_REWRITE_DURATION" ]; then
> > fi
> >
> > if [ -n "$subdir_xfile" ]; then
> > - for d in $SRC_GROUPS $FSTYP; do
> > + for d in $(get_group_dirs); do
> > [ -f $SRC_DIR/$d/$subdir_xfile ] || continue
> > for f in `sed "s/#.*$//" $SRC_DIR/$d/$subdir_xfile`; do
> > exclude_tests+=($d/$f)
> > diff --git a/common/casefold b/common/casefold
> > index 2aae5e5e6c8925..fcdb4d210028ac 100644
> > --- a/common/casefold
> > +++ b/common/casefold
> > @@ -6,6 +6,10 @@
> > _has_casefold_kernel_support()
> > {
> > case $FSTYP in
> > + fuse.ext[234])
> > + # fuse2fs does not support casefolding
> > + false
> > + ;;
>
> This would not be needed
>
> > ext4)
> > test -f '/sys/fs/ext4/features/casefold'
> > ;;
> > diff --git a/common/config b/common/config
> > index 7fa97319d7d0ca..0cd2b33c4ade40 100644
> > --- a/common/config
> > +++ b/common/config
> > @@ -386,6 +386,11 @@ _common_mount_opts()
> > overlay)
> > echo $OVERLAY_MOUNT_OPTIONS
> > ;;
> > + fuse.ext[234])
> > + # fuse sets up secure defaults, so we must explicitly tell
> > + # fuse2fs to use the more relaxed kernel access behaviors.
> > + echo "-o kernel $EXT_MOUNT_OPTIONS"
> > + ;;
> > ext2|ext3|ext4)
> > # acls & xattrs aren't turned on by default on ext$FOO
> > echo "-o acl,user_xattr $EXT_MOUNT_OPTIONS"
> > @@ -472,7 +477,7 @@ _mkfs_opts()
> > _fsck_opts()
> > {
> > case $FSTYP in
>
> This would obviously be $MKFSTYP with no further changes
>
> > - ext2|ext3|ext4)
> > + ext2|ext3|fuse.ext[234]|ext4)
> > export FSCK_OPTIONS="-nf"
> > ;;
> > reiser*)
> > @@ -514,11 +519,11 @@ _source_specific_fs()
> >
> > . ./common/btrfs
> > ;;
> > - ext4)
> > + fuse.ext4|ext4)
> > [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found"
> > . ./common/ext4
> > ;;
> > - ext2|ext3)
> > + ext2|ext3|fuse.ext[23])
> > . ./common/ext4
>
> same here
>
> > ;;
> > f2fs)
> > diff --git a/common/defrag b/common/defrag
> > index 055d0d0e9182c5..c054e62bde6f4d 100644
> > --- a/common/defrag
> > +++ b/common/defrag
> > @@ -12,7 +12,7 @@ _require_defrag()
> > _require_xfs_io_command "falloc"
> > DEFRAG_PROG="$XFS_FSR_PROG"
> > ;;
> > - ext4)
> > + fuse.ext4|ext4)
> > testfile="$TEST_DIR/$$-test.defrag"
> > donorfile="$TEST_DIR/$$-donor.defrag"
> > bsize=`_get_block_size $TEST_DIR`
>
> and here
>
> > diff --git a/common/encrypt b/common/encrypt
> > index f2687631b214cf..4fa7b6853fd461 100644
> > --- a/common/encrypt
> > +++ b/common/encrypt
> > @@ -191,7 +191,7 @@ _require_hw_wrapped_key_support()
> > _scratch_mkfs_encrypted()
> > {
> > case $FSTYP in
> > - ext4|f2fs)
> > + fuse.ext4|ext4|f2fs)
> > _scratch_mkfs -O encrypt
> > ;;
>
> and here
>
> > ubifs)
> > @@ -210,7 +210,7 @@ _scratch_mkfs_encrypted()
> > _scratch_mkfs_sized_encrypted()
> > {
> > case $FSTYP in
> > - ext4|f2fs)
> > + fuse.ext4|ext4|f2fs)
> > MKFS_OPTIONS="$MKFS_OPTIONS -O encrypt" _scratch_mkfs_sized $*
> > ;;
>
> and here... I think you got my point.
>
> Thanks,
> Amir.
>
next prev parent reply other threads:[~2025-11-05 22:53 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20251029002755.GK6174@frogsfrogsfrogs>
2025-10-29 0:42 ` [PATCHSET v6] fstests: support ext4 fuse testing Darrick J. Wong
2025-10-29 1:20 ` [PATCH 01/33] misc: adapt tests to handle the fuse ext[234] drivers Darrick J. Wong
2025-10-30 9:51 ` Amir Goldstein
2025-11-05 22:53 ` Darrick J. Wong [this message]
2025-11-06 8:58 ` Amir Goldstein
2025-11-06 23:12 ` Darrick J. Wong
2025-11-07 7:50 ` Amir Goldstein
2025-11-07 7:08 ` Zorro Lang
2025-10-29 1:20 ` [PATCH 02/33] generic/740: don't run this test for fuse ext* implementations Darrick J. Wong
2025-10-30 9:59 ` Amir Goldstein
2025-11-05 22:56 ` Darrick J. Wong
2025-11-06 9:02 ` Amir Goldstein
2025-10-29 1:21 ` [PATCH 03/33] ext/052: use popdir.pl for much faster directory creation Darrick J. Wong
2025-10-29 1:21 ` [PATCH 04/33] common/rc: skip test if swapon doesn't work Darrick J. Wong
2025-11-12 6:35 ` Baokun Li
2025-11-12 18:26 ` Darrick J. Wong
2025-11-12 20:05 ` Theodore Ts'o
2025-11-12 22:29 ` [PATCH v6.1 " Darrick J. Wong
2025-11-13 1:51 ` Baokun Li
2025-11-13 15:52 ` Theodore Ts'o
2025-10-29 1:21 ` [PATCH 05/33] common/rc: streamline _scratch_remount Darrick J. Wong
2025-10-29 1:21 ` [PATCH 06/33] ext/039: require metadata journalling Darrick J. Wong
2025-10-29 1:22 ` [PATCH 07/33] populate: don't check for htree directories on fuse.ext4 Darrick J. Wong
2025-10-29 1:22 ` [PATCH 08/33] misc: convert _scratch_mount -o remount to _scratch_remount Darrick J. Wong
2025-10-29 1:22 ` [PATCH 09/33] misc: use explicitly $FSTYP'd mount calls Darrick J. Wong
2025-10-29 1:23 ` [PATCH 10/33] common/ext4: explicitly format with $FSTYP Darrick J. Wong
2025-10-29 1:23 ` [PATCH 11/33] tests/ext*: refactor open-coded _scratch_mkfs_sized calls Darrick J. Wong
2025-10-29 1:23 ` [PATCH 12/33] generic/732: disable for fuse.ext4 Darrick J. Wong
2025-10-29 1:23 ` [PATCH 13/33] defrag: fix ext4 defrag ioctl test Darrick J. Wong
2025-10-29 1:24 ` [PATCH 14/33] misc: explicitly require online resize support Darrick J. Wong
2025-10-29 1:24 ` [PATCH 15/33] ext4/004: disable for fuse2fs Darrick J. Wong
2025-10-29 1:24 ` [PATCH 16/33] generic/679: " Darrick J. Wong
2025-10-29 1:24 ` [PATCH 17/33] ext4/045: don't run the long dirent test on fuse2fs Darrick J. Wong
2025-10-29 1:25 ` [PATCH 18/33] generic/338: skip test if we can't mount with strictatime Darrick J. Wong
2025-10-29 1:25 ` [PATCH 19/33] generic/563: fuse doesn't support cgroup-aware writeback accounting Darrick J. Wong
2025-10-29 1:25 ` [PATCH 20/33] misc: use a larger buffer size for pwrites Darrick J. Wong
2025-10-29 1:25 ` [PATCH 21/33] ext4/046: don't run this test if dioread_nolock not supported Darrick J. Wong
2025-10-29 1:26 ` [PATCH 22/33] generic/631: don't run test if we can't mount overlayfs Darrick J. Wong
2025-10-30 11:35 ` Amir Goldstein
2025-11-05 23:12 ` Darrick J. Wong
2025-11-06 9:23 ` Amir Goldstein
2025-11-06 16:02 ` Darrick J. Wong
2025-10-29 1:26 ` [PATCH 23/33] generic/{409,410,411,589}: check for stacking mount support Darrick J. Wong
2025-10-30 10:25 ` Amir Goldstein
2025-11-05 22:58 ` Darrick J. Wong
2025-10-29 1:26 ` [PATCH 24/33] generic: add _require_hardlinks to tests that require hardlinks Darrick J. Wong
2025-10-29 1:26 ` [PATCH 25/33] ext4/001: check for fiemap support Darrick J. Wong
2025-10-29 1:27 ` [PATCH 26/33] generic/622: check that strictatime/lazytime actually work Darrick J. Wong
2025-10-29 1:27 ` [PATCH 27/33] generic/050: skip test because fuse2fs doesn't have stable output Darrick J. Wong
2025-10-30 10:05 ` Amir Goldstein
2025-11-05 23:02 ` Darrick J. Wong
2025-10-29 1:27 ` [PATCH 28/33] generic/405: don't stall on mkfs asking for input Darrick J. Wong
2025-10-29 1:27 ` [PATCH 29/33] ext4/006: fix this test Darrick J. Wong
2025-10-29 1:28 ` [PATCH 30/33] ext4/009: fix ENOSPC errors Darrick J. Wong
2025-10-29 1:28 ` [PATCH 31/33] ext4/022: enabl Darrick J. Wong
2025-10-29 6:03 ` Darrick J. Wong
2025-10-29 1:28 ` [PATCH 32/33] generic/730: adapt test for fuse filesystems Darrick J. Wong
2025-10-29 1:29 ` [PATCH 33/33] fuse2fs: hack around weird corruption problems Darrick J. Wong
2025-10-29 9:35 ` [PATCHSET v6] fstests: support ext4 fuse testing Christoph Hellwig
2025-10-29 23:52 ` 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=20251105225355.GC196358@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=amir73il@gmail.com \
--cc=bernd@bsbernd.com \
--cc=fstests@vger.kernel.org \
--cc=joannelkoong@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=neal@gompa.dev \
--cc=zlang@redhat.com \
/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