From: Jakob Unterwurzacher <jakobunt@gmail.com>
To: fstests@vger.kernel.org, jakobunt@gmail.com
Subject: [PATCH] fstests: add fuse.gocryptfs support
Date: Sun, 16 Nov 2025 19:45:38 +0100 [thread overview]
Message-ID: <20251116184545.3450048-1-jakobunt@gmail.com> (raw)
Add instructions for testing gocryptfs, an encrypted overlay filesystem,
and a few small changes that were needed for gocryptfs compatibility:
1) _scratch_unmount and _test_unmount now unmount fuse filesystems
via mountpoint instead of via device. Unmounting via device fails when
the "device" is actually a directory on a different filesystem.
Unmounting via mountpoint always works.
2) Add subtype=passthrough_ll to the passthrough_ll mount options.
This makes passthrough_ll behave more like most other fuse filesystems
which do set a subtype. Example from my Fedora box:
$ mount | grep -o "type fuse\\..* "
type fuse.gvfsd-fuse
type fuse.portal
type fuse.gocryptfs
type fuse.encfs
type fuse.passthrough_ll
With this change, _check_mounted_on can match on $FSTYP$FUSE_SUBTYP
for passthrough_ll, which also works for gocryptfs and likely most
other fuse filesystems.
Results for passthrough_ll on top of tmpfs:
Failures: generic/120 generic/125 generic/184 generic/294 generic/306 generic/317 generic/355
generic/363 generic/426 generic/434 generic/452 generic/467 generic/477 generic/633 generic/647
generic/653 generic/675 generic/683 generic/684 generic/729 generic/745 generic/751 generic/756
generic/777
Failed 24 of 769 tests
Results for gocryptfs on top of tmpfs:
Failures: generic/020 generic/062 generic/093 generic/099 generic/103 generic/120 generic/125
generic/184 generic/285 generic/294 generic/306 generic/317 generic/319 generic/426 generic/434
generic/444 generic/452 generic/467 generic/471 generic/477 generic/633 generic/676 generic/683
generic/688 generic/696 generic/697 generic/707 generic/756 generic/777
Failed 29 of 769 tests
Signed-off-by: Jakob Unterwurzacher <jakobunt@gmail.com>
---
README.fuse | 34 ++++++++++++++++++++++++++++++++--
common/rc | 11 ++++++++++-
2 files changed, 42 insertions(+), 3 deletions(-)
diff --git a/README.fuse b/README.fuse
index 969dbd5d..df248681 100644
--- a/README.fuse
+++ b/README.fuse
@@ -1,3 +1,6 @@
+passthrough_ll
+==============
+
Here are instructions for testing fuse using the passthrough_ll example
filesystem provided in the libfuse source tree:
@@ -22,5 +25,32 @@ export SCRATCH_DEV=non2
export SCRATCH_MNT=/mnt/scratch
export FSTYP=fuse
export FUSE_SUBTYP=.passthrough_ll
-export MOUNT_OPTIONS="-osource=/home/test/scratch,allow_other,default_permissions"
-export TEST_FS_MOUNT_OPTS="-osource=/home/test/test,allow_other,default_permissions"
+export MOUNT_OPTIONS="-osource=/home/test/scratch,subtype=passthrough_ll,allow_other,default_permissions"
+export TEST_FS_MOUNT_OPTS="-osource=/home/test/test,subtype=passthrough_ll,allow_other,default_permissions"
+
+
+gocryptfs
+=========
+
+Here are the instructions for gocryptfs:
+
+git clone https://github.com/rfjakob/gocryptfs.git
+cd gocryptfs
+./build.bash
+cat << EOF | sudo tee /sbin/mount.fuse.gocryptfs
+#!/bin/bash
+exec $(pwd)/gocryptfs -q -allow_other -acl -extpass "echo test" "\$@"
+EOF
+sudo chmod +x /sbin/mount.fuse.gocryptfs
+mkdir -p /mnt/gocryptfs.test /mnt/gocryptfs.scratch /home/test/gocryptfs.test /home/test/gocryptfs.scratch
+gocryptfs -init -q -scryptn=10 -extpass "echo test" /home/test/gocryptfs.test
+gocryptfs -init -q -scryptn=10 -extpass "echo test" /home/test/gocryptfs.scratch
+
+Use the following local.config file:
+
+export TEST_DEV=/home/test/gocryptfs.test
+export TEST_DIR=/mnt/gocryptfs.test
+export SCRATCH_DEV=/home/test/gocryptfs.scratch
+export SCRATCH_MNT=/mnt/gocryptfs.scratch
+export FSTYP=fuse
+export FUSE_SUBTYP=.gocryptfs
diff --git a/common/rc b/common/rc
index 8fd7876a..da8be16e 100644
--- a/common/rc
+++ b/common/rc
@@ -512,6 +512,11 @@ _scratch_unmount()
tmpfs)
_unmount $SCRATCH_MNT
;;
+ fuse)
+ # The "source device" can be an arbitrary string for fuse filesystems
+ # and may not be unique. Unmount by mountpoint instead.
+ _unmount $SCRATCH_MNT
+ ;;
*)
_unmount $SCRATCH_DEV
;;
@@ -703,6 +708,10 @@ _test_unmount()
{
if [ "$FSTYP" == "overlay" ]; then
_overlay_test_unmount
+ elif [ "$FSTYP" == "fuse" ]; then
+ # The "source device" can be an arbitrary string for fuse filesystems
+ # and may not be unique. Unmount by mountpoint instead.
+ _unmount $TEST_DIR
else
_unmount $TEST_DEV
fi
@@ -5021,7 +5030,7 @@ init_rc()
# Sanity check that TEST partition is not mounted at another mount point
# or as another fs type
- _check_mounted_on TEST_DEV $TEST_DEV TEST_DIR $TEST_DIR $FSTYP || _exit 1
+ _check_mounted_on TEST_DEV $TEST_DEV TEST_DIR $TEST_DIR $FSTYP$FUSE_SUBTYP || exit 1
if [ -n "$SCRATCH_DEV" ]; then
# Sanity check that SCRATCH partition is not mounted at another
# mount point, because it is about to be unmounted and formatted.
--
2.51.0
next reply other threads:[~2025-11-16 18:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-16 18:45 Jakob Unterwurzacher [this message]
2025-11-19 12:49 ` [PATCH] fstests: add fuse.gocryptfs support Zorro Lang
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=20251116184545.3450048-1-jakobunt@gmail.com \
--to=jakobunt@gmail.com \
--cc=fstests@vger.kernel.org \
/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