[LTP] [PATCH] df01: detect "fuse" fstype in addition to "fuseblk"

Vasileios Almpanis vasileios.almpanis@virtuozzo.com
Wed Jul 1 13:00:28 CEST 2026


df01.sh derives DF_FS_TYPE by matching the test mount in /proc/mounts
against either the real FS type or "fuseblk", the type used when
ntfs-3g/FUSE mounts a block device via the privileged blkdev path.

However, when the filesystem is mounted from inside a user namespace or
an unprivileged/virtualized container, that path is unavailable: the
kernel's fuseblk file_system_type lacks FS_USERNS_MOUNT and requires
FS_REQUIRES_DEV, so libfuse/ntfs-3g falls back to a plain anonymous
mount and the kernel reports the type as "fuse" instead of "fuseblk":

  /dev/loop0 /mnt fuse rw,relatime,user_id=0,group_id=0,allow_other

In that case the grep matches nothing and DF_FS_TYPE becomes empty,
which breaks two subtests:

  test5:  "df -t $DF_FS_TYPE -P" collapses to "df -t -P"; -t consumes
          -P as its type argument -> "df: no file systems processed",
          non-zero exit -> TFAIL.
  test12: "df -x $DF_FS_TYPE -P" collapses to "df -x -P"; the device is
          no longer excluded and appears in the output -> TFAIL.

Add "fuse" so the containerized/userns FUSE mount is detected too.

Signed-off-by: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
---
 testcases/commands/df/df01.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/commands/df/df01.sh b/testcases/commands/df/df01.sh
index 5af4f68e6..72b02ce34 100755
--- a/testcases/commands/df/df01.sh
+++ b/testcases/commands/df/df01.sh
@@ -15,7 +15,7 @@ TST_NEEDS_ROOT=1
 
 setup()
 {
-	DF_FS_TYPE="$(grep -E "$TST_MNTPOINT ($TST_FS_TYPE|fuseblk)" /proc/mounts | awk 'NR==1{print $3}')"
+	DF_FS_TYPE="$(grep -E "$TST_MNTPOINT ($TST_FS_TYPE|fuseblk|fuse)" /proc/mounts | awk 'NR==1{print $3}')"
 }
 
 df_test()
-- 
2.47.3



More information about the ltp mailing list