From dc31352d6c926e0f6da6238eccbcaa96b1fb89c2 Mon Sep 17 00:00:00 2001 From: Amir Goldstein Date: Thu, 30 Oct 2025 12:24:21 +0100 Subject: [PATCH] generic/631: don't run test if we can't mount overlayfs This test fails on fuse2fs with the following: mount: /opt/merged0: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error. dmesg(1) may have more information after failed mount system call. dmesg logs the following: [ 764.775172] overlayfs: upper fs does not support tmpfile. [ 764.777707] overlayfs: upper fs does not support RENAME_WHITEOUT. From this, it's pretty clear why the test fails -- overlayfs checks that the upper filesystem (fuse2fs) supports RENAME_WHITEOUT and O_TMPFILE. fuse2fs doesn't support either of these, so the mount fails and then the test goes wild. Instead of doing that, let's do an initial test mount with the same options as the workers, and _notrun if that first mount doesn't succeed. Fixes: 210089cfa00315 ("generic: test a deadlock in xfs_rename when whiteing out files") Suggested-by: "Darrick J. Wong" Signed-off-by: Amir Goldstein --- tests/generic/631 | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/tests/generic/631 b/tests/generic/631 index c38ab771..7dc335aa 100755 --- a/tests/generic/631 +++ b/tests/generic/631 @@ -46,7 +46,6 @@ _require_extra_fs overlay _scratch_mkfs >> $seqres.full _scratch_mount -_supports_filetype $SCRATCH_MNT || _notrun "overlayfs test requires d_type" mkdir $SCRATCH_MNT/lowerdir mkdir $SCRATCH_MNT/lowerdir1 @@ -64,7 +63,7 @@ stop_workers() { done } -worker() { +mount_overlay() { local tag="$1" local mergedir="$SCRATCH_MNT/merged$tag" local l="lowerdir=$SCRATCH_MNT/lowerdir:$SCRATCH_MNT/lowerdir1" @@ -72,25 +71,43 @@ worker() { local w="workdir=$SCRATCH_MNT/workdir$tag" local i="index=off" + rm -rf $SCRATCH_MNT/merged$tag + rm -rf $SCRATCH_MNT/upperdir$tag + rm -rf $SCRATCH_MNT/workdir$tag + mkdir $SCRATCH_MNT/merged$tag + mkdir $SCRATCH_MNT/workdir$tag + mkdir $SCRATCH_MNT/upperdir$tag + + mount -t overlay overlay -o "$l,$u,$w,$i" "$mergedir" +} + +unmount_overlay() { + local tag="$1" + local mergedir="$SCRATCH_MNT/merged$tag" + + _unmount $mergedir +} + +worker() { + local tag="$1" + local mergedir="$SCRATCH_MNT/merged$tag" + touch $SCRATCH_MNT/workers/$tag while test -e $SCRATCH_MNT/running; do - rm -rf $SCRATCH_MNT/merged$tag - rm -rf $SCRATCH_MNT/upperdir$tag - rm -rf $SCRATCH_MNT/workdir$tag - mkdir $SCRATCH_MNT/merged$tag - mkdir $SCRATCH_MNT/workdir$tag - mkdir $SCRATCH_MNT/upperdir$tag - - mount -t overlay overlay -o "$l,$u,$w,$i" $mergedir + mount_overlay $tag mv $mergedir/etc/access.conf $mergedir/etc/access.conf.bak touch $mergedir/etc/access.conf mv $mergedir/etc/access.conf $mergedir/etc/access.conf.bak touch $mergedir/etc/access.conf - _unmount $mergedir + unmount_overlay $tag done rm -f $SCRATCH_MNT/workers/$tag } +mount_overlay check || \ + _notrun "cannot mount overlayfs with underlying filesystem $FSTYP" +unmount_overlay check + for i in $(seq 0 $((4 + LOAD_FACTOR)) ); do worker $i & done -- 2.51.1