Skip to contentSkip to conversation

overlay tests: generalize _check_overlay_feature for param-less mount options

PATCH Superseded Prabhakar Pujeri 2 participants 7 messages Sep 15 – Sep 16

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover overlay tests: generalize _check_overlay_feature for param-less mount options

Followup on the RFC from 2026-09-02:
https://lore.kernel.org/fstests/[email protected]/
Amir answered the same day: "The patch would be welcome".

This series exchanges six open-coded xino capability probes plus 081's ad-hoc uuid probe for _require_scratch_overlay_features, made possible by a small generalization of _check_overlay_feature for mount options that have no on/off module parameter of the same name (uuid, xino, verity, fsync, ...).

01 teaches the helper: for such options, a missing parameter means
"defaults off" rather than "unsupported" (per Amir's sketch); support is then validated by the probe mount itself, which a kernel without the option rejects with EINVAL.
02 folds the six xino tests (overlay/041, 043, 044, 067, 070, 071) onto
the generalized helper, deleting the open-coded mount+grep probes.
03 switches overlay/081's ad-hoc uuid=null probe to
_require_scratch_overlay_features uuid; the remaining mounts in the test keep their current options and legacy uuid behavior is unchanged.

Behavior note: on kernels with overlayfs support for these options, _require_scratch_overlay_features previously notran'd for xino/uuid (because /sys/module/overlay/parameters/{uuid,xino} does not exist); after this change the probe mount carries the check, and such kernels pass as long as the mount options are accepted.

Prabhakar Pujeri (3):
common/overlay: let _check_overlay_feature handle param-less options tests/overlay: use _require_scratch_overlay_features for xino overlay/081: require uuid via _require_scratch_overlay_features

 common/overlay    | 19 +++++++++++++------
 tests/overlay/041 |  6 ++----
 tests/overlay/043 |  6 ++----
 tests/overlay/044 |  6 ++----
 tests/overlay/067 |  4 ++--
 tests/overlay/070 |  7 ++-----
 tests/overlay/071 | 12 +++---------
 tests/overlay/081 |  8 ++++++--
 8 files changed, 32 insertions(+), 36 deletions(-)
Signature · 1 line
2.55.0
#1 lore raw

PATCH 1/3 common/overlay: let _check_overlay_feature handle param-less options

overlayfs mount options like uuid, xino, verity and fsync have no on/off module parameter of the same name, so _get_fs_module_param returns nothing for them and _require_scratch_overlay_features notruns before the probe mount is even tried.

Per Amir's suggestion on the overlay/081 review thread, a missing parameter for such options means 'defaults off' rather than 'unsupported': generalize _check_overlay_feature to treat a missing or non-boolean parameter as default N, and drop the parameter existence pre-check from _require_scratch_overlay_features. Support is then validated by the probe mount itself - a too-old kernel that does not know the option rejects it with EINVAL and the require notruns as before.

This lets tests require param-less options uniformly, e.g. _require_scratch_overlay_features xino / uuid.

---
 common/overlay | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
common/overlay +13 -6
index d32f3219..89413933 100644
@@ -172,8 +172,15 @@ _check_overlay_feature()
 	# parameter (the system default) and per mount by mount
 	# option ${feature}=[on|off].
 	local default=`_get_fs_module_param ${feature}`
-	[ "$default" = Y ] || [ "$default" = N ] || \
-		_notrun "feature '${feature}' not supported by ${FSTYP}"
+	if [ "$default" != Y ] && [ "$default" != N ]; then
+		# Some mount options (e.g. uuid, xino, verity, fsync)
+		# have no on/off module parameter of the same name.
+		# For those, a missing (or non-boolean) parameter means
+		# that the feature defaults to off rather than that it
+		# is unsupported.  Unsupported options are rejected by
+		# the probe mount in _require_scratch_overlay_features.
+		default=N
+	fi
 
 	# Check options to be sure. For example, Overlayfs will fallback to
 	# index=off if underlying fs does not support file handles.
@@ -192,10 +199,10 @@ _require_scratch_overlay_features()
 	local opts="rw"
 
 	for feature in ${features[*]}; do
-		# If the module parameter does not exist then there is no
-		# point in checking the mount option.
-		_get_fs_module_param ${feature} > /dev/null 2>&1 || \
-			_notrun "feature '${feature}' not supported by overlay"
+		# Some mount options (e.g. uuid, xino, verity, fsync)
+		# have no on/off module parameter of the same name.
+		# For those the probe mount below is what validates
+		# support, so a missing parameter is fine.
 		opts+=",${feature}=on"
 	done
 
Signature · 1 line
2.55.0
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] common/overlay: let _check_overlay_feature handle param-less options

Quoted 15 lines · Prabhakar Pujeri

overlayfs mount options like uuid, xino, verity and fsync have no on/off module parameter of the same name, so _get_fs_module_param returns nothing for them and _require_scratch_overlay_features notruns before the probe mount is even tried.

Per Amir's suggestion on the overlay/081 review thread, a missing parameter for such options means 'defaults off' rather than 'unsupported': generalize _check_overlay_feature to treat a missing or non-boolean parameter as default N, and drop the parameter existence pre-check from _require_scratch_overlay_features. Support is then validated by the probe mount itself - a too-old kernel that does not know the option rejects it with EINVAL and the require notruns as before.

Quoted 5 lines

This lets tests require param-less options uniformly, e.g. _require_scratch_overlay_features xino / uuid.

Hi Prabhakar,

Thanks for following up.
Feel free to add

After fixing one small nits below...

Quoted 9 lines
---
 common/overlay | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
common/overlay +0 -0
index d32f3219..89413933 100644

common/overlay _check_overlay_feature() · line 176

Quoted 7 lines
common/overlay +2 -2
@@ -172,8 +172,15 @@ _check_overlay_feature()
        # parameter (the system default) and per mount by mount
        # option ${feature}=[on|off].
        local default=`_get_fs_module_param ${feature}`
-       [ "$default" = Y ] || [ "$default" = N ] || \
-               _notrun "feature '${feature}' not supported by ${FSTYP}"
+       if [ "$default" != Y ] && [ "$default" != N ]; then
+               # Some mount options (e.g. uuid, xino, verity, fsync)

fsync does not have on/off so better take it off this list to avoid confusion

Quoted 14 lines
common/overlay +7 -0
+               # have no on/off module parameter of the same name.
+               # For those, a missing (or non-boolean) parameter means
+               # that the feature defaults to off rather than that it
+               # is unsupported.  Unsupported options are rejected by
+               # the probe mount in _require_scratch_overlay_features.
+               default=N
+       fi
 
        # Check options to be sure. For example, Overlayfs will fallback to
        # index=off if underlying fs does not support file handles.
@@ -192,10 +199,10 @@ _require_scratch_overlay_features()
        local opts="rw"
 
        for feature in ${features[*]}; do

common/overlay _require_scratch_overlay_features() · line 207

Quoted 10 lines
common/overlay +4 -4
-               # If the module parameter does not exist then there is no
-               # point in checking the mount option.
-               _get_fs_module_param ${feature} > /dev/null 2>&1 || \
-                       _notrun "feature '${feature}' not supported by overlay"
+               # Some mount options (e.g. uuid, xino, verity, fsync)
+               # have no on/off module parameter of the same name.
+               # For those the probe mount below is what validates
+               # support, so a missing parameter is fine.
                opts+=",${feature}=on"
        done

Apart from repeating the fsync option mistake, this comment feels out of context after removing the _get_fs_module_param line. Does it document the past code?
I think that a simple "Validate that mount option can be enabled" comment will be enough here.

Thanks,
Amir.

#3 lore raw

PATCH 2/3 tests/overlay: use _require_scratch_overlay_features for xino

In reply to Prabhakar Pujeri

overlay/041, 043, 044, 067, 070 and 071 open-code their xino probes:
a mount with -o xino=on|off followed by a selective grep of the mount options. Now that _check_overlay_feature handles param-less options, fold all six onto _require_scratch_overlay_features xino and delete the open-coded variants. The behavior is unchanged - a kernel that does not support xino rejects the probe mount and the test notruns.

---
 tests/overlay/041 |  6 ++----
 tests/overlay/043 |  6 ++----
 tests/overlay/044 |  6 ++----
 tests/overlay/067 |  4 ++--
 tests/overlay/070 |  7 ++-----
 tests/overlay/071 | 12 +++---------
 6 files changed, 13 insertions(+), 28 deletions(-)
tests/overlay/041 +2 -4
index 36491b8f..4d2c830d 100755
@@ -23,6 +23,7 @@ _require_scratch_nocheck
 _require_test
 _require_attrs trusted
 _require_test_program "t_dir_type"
+_require_scratch_overlay_features xino
 
 lowerdir=$OVL_BASE_TEST_DIR/$seq-ovl-lower
 rm -rf $lowerdir
@@ -41,10 +42,7 @@ workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
 # not use bit 63 in inode number of the test files, because bit 63 is used by
 # overlayfs to indicate the layer. Let's just assume that this is true for all
 # tested filesystems and if we are wrong, the test may fail.
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o xino=on || \
-	_notrun "cannot mount overlay with xino=on option"
-_fs_options $SCRATCH_DEV | grep -q "xino=on" || \
-	_notrun "cannot enable xino feature"
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o xino=on
 
 test_dir=$SCRATCH_MNT/test_dir/
 
tests/overlay/043 +2 -4
index 7325c653..efb99cd5 100755
@@ -33,6 +33,7 @@ _require_test_program "af_unix"
 _require_test_program "t_dir_type"
 # Require redirect_dir for renaming a merge directory
 _require_scratch_feature redirect_dir
+_require_scratch_overlay_features xino
 
 lowerdir=$OVL_BASE_TEST_DIR/$seq-ovl-lower
 rm -rf $lowerdir
@@ -57,10 +58,7 @@ workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
 # not use bit 63 in inode number of the test files, because bit 63 is used by
 # overlayfs to indicate the layer. Let's just assume that this is true for all
 # tested filesystems and if we are wrong, the test may fail.
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on || \
-	_notrun "cannot mount overlay with xino=on option"
-_fs_options $SCRATCH_DEV | grep -q "xino=on" || \
-	_notrun "cannot enable xino feature"
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on
 
 FILES="dir file symlink chrdev blkdev fifo socket"
 
tests/overlay/044 +2 -4
index 4d04d883..08e38dfd 100755
@@ -26,6 +26,7 @@ _require_scratch_nocheck
 _require_test
 _require_scratch_feature index
 _require_test_program "t_dir_type"
+_require_scratch_overlay_features xino
 
 # Record inode numbers in format <ino> <nlink>
 function record_ino_nlink()
@@ -73,10 +74,7 @@ workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
 # not use bit 63 in inode number of the test files, because bit 63 is used by
 # overlayfs to indicate the layer. Let's just assume that this is true for all
 # tested filesystems and if we are wrong, the test may fail.
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on,xino=on || \
-	_notrun "cannot mount overlay with xino=on option"
-_fs_options $SCRATCH_DEV | grep -q "xino=on" || \
-	_notrun "cannot enable xino feature"
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on,xino=on
 
 rm -f $tmp.*
 
tests/overlay/067 +2 -2
index bb09a604..d3f98f17 100755
@@ -25,6 +25,7 @@ _fixed_by_kernel_commit 9c6d8f13e9da \
 # them explicity after test.
 _require_scratch_nocheck
 _require_test
+_require_scratch_overlay_features xino
 
 # Lower is on test partition
 lower=$OVL_BASE_TEST_DIR/$OVL_LOWER-$seq
@@ -47,8 +48,7 @@ echo wrong > $realfile
 # Mount an overlay on $SCRATCH_MNT with lower layer on test partition
 # and middle and upper layer on scratch partition.
 # Disable xino, so not all overlay inodes are on the same st_dev.
-_overlay_scratch_mount_dirs $middle:$lower $upper $work -o xino=off || \
-	_notrun "cannot mount overlay with xino=off option"
+_overlay_scratch_mount_dirs $middle:$lower $upper $work -o xino=off
 
 stat $realfile >>$seqres.full
 stat $testfile >>$seqres.full
tests/overlay/070 +2 -5
index 36991229..c64e7907 100755
@@ -41,7 +41,7 @@ _require_test_program "t_dir_type"
 _require_command "$FLOCK_PROG" "flock"
 # We need to require all features together, because nfs_export cannot
 # be enabled when index is disabled
-_require_scratch_overlay_features index nfs_export redirect_dir
+_require_scratch_overlay_features index nfs_export redirect_dir xino
 _require_loop
 
 lower=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
@@ -83,10 +83,7 @@ mount_dirs()
 	# overlayfs to indicate the layer. Let's just assume that this is true for all
 	# tested filesystems and if we are wrong, the test may fail.
 	_overlay_mount_dirs $SCRATCH_MNT $upper2 $work2 overlay2 $mnt2 \
-		-o "redirect_dir=on,index=on,xino=on" || \
-		_notrun "cannot mount nested overlay with xino=on option"
-	_fs_options overlay2 | grep -q "xino=on" || \
-		_notrun "cannot enable xino feature on nested overlay"
+		-o "redirect_dir=on,index=on,xino=on"
 }
 
 # Unmount the nested overlay mount and check underlying overlay layers
tests/overlay/071 +3 -9
index 2a631314..ef429d41 100755
@@ -45,7 +45,7 @@ _require_test_program "t_dir_type"
 _require_command "$FLOCK_PROG" "flock"
 # We need to require all features together, because nfs_export cannot
 # be enabled when index is disabled
-_require_scratch_overlay_features index nfs_export redirect_dir
+_require_scratch_overlay_features index nfs_export redirect_dir xino
 _require_loop
 
 # Lower overlay lower layer is on test fs, upper is on scratch fs
@@ -81,10 +81,7 @@ mount_dirs()
 {
 	# Mount the underlying overlay with file handle support
 	_overlay_mount_dirs $lower $upper $work overlay1 $SCRATCH_MNT \
-		-o "index=on,nfs_export=on,xino=on" || \
-                _notrun "cannot mount overlay with xino=on option"
-	_fs_options overlay1 | grep -q "xino=on" || \
-		_notrun "cannot enable xino feature on overlay"
+		-o "index=on,nfs_export=on,xino=on"
 
 	# Mount the nested overlay
 	# Enable redirect_dir for renaming a merge directory.
@@ -93,10 +90,7 @@ mount_dirs()
 	# overlayfs to indicate the layer. Let's just assume that this is true for all
 	# tested filesystems and if we are wrong, the test may fail.
 	_overlay_mount_dirs $SCRATCH_MNT $upper2 $work2 overlay2 $mnt2 \
-		-o "redirect_dir=on,index=on,xino=on" || \
-		_notrun "cannot mount nested overlay with xino=on option"
-	_fs_options overlay2 | grep -q "xino=on" || \
-		_notrun "cannot enable xino feature on nested overlay"
+		-o "redirect_dir=on,index=on,xino=on"
 }
 
 # Unmount the nested overlay mount and check underlying overlay layers
Signature · 1 line
2.55.0
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] tests/overlay: use _require_scratch_overlay_features for xino

Quoted 9 lines · Prabhakar Pujeri

overlay/041, 043, 044, 067, 070 and 071 open-code their xino probes:
a mount with -o xino=on|off followed by a selective grep of the mount options. Now that _check_overlay_feature handles param-less options, fold all six onto _require_scratch_overlay_features xino and delete the open-coded variants. The behavior is unchanged - a kernel that does not support xino rejects the probe mount and the test notruns.

Quoted 9 lines
---
 tests/overlay/041 |  6 ++----
 tests/overlay/043 |  6 ++----
 tests/overlay/044 |  6 ++----
 tests/overlay/067 |  4 ++--
 tests/overlay/070 |  7 ++-----
 tests/overlay/071 | 12 +++---------
 6 files changed, 13 insertions(+), 28 deletions(-)

Nice cleanup!
Thanks for following up on this

(see one note below)

Quoted 145 lines
tests/overlay/041 +2 -4
index 36491b8f..4d2c830d 100755
@@ -23,6 +23,7 @@ _require_scratch_nocheck
 _require_test
 _require_attrs trusted
 _require_test_program "t_dir_type"
+_require_scratch_overlay_features xino
 
 lowerdir=$OVL_BASE_TEST_DIR/$seq-ovl-lower
 rm -rf $lowerdir
@@ -41,10 +42,7 @@ workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
 # not use bit 63 in inode number of the test files, because bit 63 is used by
 # overlayfs to indicate the layer. Let's just assume that this is true for all
 # tested filesystems and if we are wrong, the test may fail.
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o xino=on || \
-       _notrun "cannot mount overlay with xino=on option"
-_fs_options $SCRATCH_DEV | grep -q "xino=on" || \
-       _notrun "cannot enable xino feature"
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o xino=on
 
 test_dir=$SCRATCH_MNT/test_dir/
 
tests/overlay/043 +2 -4
index 7325c653..efb99cd5 100755
@@ -33,6 +33,7 @@ _require_test_program "af_unix"
 _require_test_program "t_dir_type"
 # Require redirect_dir for renaming a merge directory
 _require_scratch_feature redirect_dir
+_require_scratch_overlay_features xino
 
 lowerdir=$OVL_BASE_TEST_DIR/$seq-ovl-lower
 rm -rf $lowerdir
@@ -57,10 +58,7 @@ workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
 # not use bit 63 in inode number of the test files, because bit 63 is used by
 # overlayfs to indicate the layer. Let's just assume that this is true for all
 # tested filesystems and if we are wrong, the test may fail.
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on || \
-       _notrun "cannot mount overlay with xino=on option"
-_fs_options $SCRATCH_DEV | grep -q "xino=on" || \
-       _notrun "cannot enable xino feature"
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on
 
 FILES="dir file symlink chrdev blkdev fifo socket"
 
tests/overlay/044 +2 -4
index 4d04d883..08e38dfd 100755
@@ -26,6 +26,7 @@ _require_scratch_nocheck
 _require_test
 _require_scratch_feature index
 _require_test_program "t_dir_type"
+_require_scratch_overlay_features xino
 
 # Record inode numbers in format <ino> <nlink>
 function record_ino_nlink()
@@ -73,10 +74,7 @@ workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
 # not use bit 63 in inode number of the test files, because bit 63 is used by
 # overlayfs to indicate the layer. Let's just assume that this is true for all
 # tested filesystems and if we are wrong, the test may fail.
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on,xino=on || \
-       _notrun "cannot mount overlay with xino=on option"
-_fs_options $SCRATCH_DEV | grep -q "xino=on" || \
-       _notrun "cannot enable xino feature"
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on,xino=on
 
 rm -f $tmp.*
 
tests/overlay/067 +2 -2
index bb09a604..d3f98f17 100755
@@ -25,6 +25,7 @@ _fixed_by_kernel_commit 9c6d8f13e9da \
 # them explicity after test.
 _require_scratch_nocheck
 _require_test
+_require_scratch_overlay_features xino
 
 # Lower is on test partition
 lower=$OVL_BASE_TEST_DIR/$OVL_LOWER-$seq
@@ -47,8 +48,7 @@ echo wrong > $realfile
 # Mount an overlay on $SCRATCH_MNT with lower layer on test partition
 # and middle and upper layer on scratch partition.
 # Disable xino, so not all overlay inodes are on the same st_dev.
-_overlay_scratch_mount_dirs $middle:$lower $upper $work -o xino=off || \
-       _notrun "cannot mount overlay with xino=off option"
+_overlay_scratch_mount_dirs $middle:$lower $upper $work -o xino=off
 
 stat $realfile >>$seqres.full
 stat $testfile >>$seqres.full
tests/overlay/070 +2 -5
index 36991229..c64e7907 100755
@@ -41,7 +41,7 @@ _require_test_program "t_dir_type"
 _require_command "$FLOCK_PROG" "flock"
 # We need to require all features together, because nfs_export cannot
 # be enabled when index is disabled
-_require_scratch_overlay_features index nfs_export redirect_dir
+_require_scratch_overlay_features index nfs_export redirect_dir xino
 _require_loop
 
 lower=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
@@ -83,10 +83,7 @@ mount_dirs()
        # overlayfs to indicate the layer. Let's just assume that this is true for all
        # tested filesystems and if we are wrong, the test may fail.
        _overlay_mount_dirs $SCRATCH_MNT $upper2 $work2 overlay2 $mnt2 \
-               -o "redirect_dir=on,index=on,xino=on" || \
-               _notrun "cannot mount nested overlay with xino=on option"
-       _fs_options overlay2 | grep -q "xino=on" || \
-               _notrun "cannot enable xino feature on nested overlay"
+               -o "redirect_dir=on,index=on,xino=on"
 }
 
 # Unmount the nested overlay mount and check underlying overlay layers
tests/overlay/071 +2 -5
index 2a631314..ef429d41 100755
@@ -45,7 +45,7 @@ _require_test_program "t_dir_type"
 _require_command "$FLOCK_PROG" "flock"
 # We need to require all features together, because nfs_export cannot
 # be enabled when index is disabled
-_require_scratch_overlay_features index nfs_export redirect_dir
+_require_scratch_overlay_features index nfs_export redirect_dir xino
 _require_loop
 
 # Lower overlay lower layer is on test fs, upper is on scratch fs
@@ -81,10 +81,7 @@ mount_dirs()
 {
        # Mount the underlying overlay with file handle support
        _overlay_mount_dirs $lower $upper $work overlay1 $SCRATCH_MNT \
-               -o "index=on,nfs_export=on,xino=on" || \
-                _notrun "cannot mount overlay with xino=on option"
-       _fs_options overlay1 | grep -q "xino=on" || \
-               _notrun "cannot enable xino feature on overlay"
+               -o "index=on,nfs_export=on,xino=on"
 
        # Mount the nested overlay
        # Enable redirect_dir for renaming a merge directory.

tests/overlay/071 mount_dirs() · line 95

Quoted 10 lines
tests/overlay/071 +1 -4
@@ -93,10 +90,7 @@ mount_dirs()
        # overlayfs to indicate the layer. Let's just assume that this is true for all
        # tested filesystems and if we are wrong, the test may fail.
        _overlay_mount_dirs $SCRATCH_MNT $upper2 $work2 overlay2 $mnt2 \
-               -o "redirect_dir=on,index=on,xino=on" || \
-               _notrun "cannot mount nested overlay with xino=on option"
-       _fs_options overlay2 | grep -q "xino=on" || \
-               _notrun "cannot enable xino feature on nested overlay"
+               -o "redirect_dir=on,index=on,xino=on"
 }
 

Technically this used to test "enable xino feature on nested overlay" I think there might have been a very old kernel version where this was not supported, but I don't remember and it might be old enough that we do not care in the context of fstests because there is no longer an LTS kernel where this would matter.
If there is, then the test would fail and someone will complain, so I am not concerned.

Thanks,
Amir.

#5 lore raw

PATCH 3/3 overlay/081: require uuid via _require_scratch_overlay_features

In reply to Prabhakar Pujeri

The ad-hoc check hid the mount output and treated any mount failure as 'overlayfs does not support uuid'. Route the requirement through the generalized helper instead: the probe mount still rejects on a pre-6.6 kernel with EINVAL, and the options check remains via mount options.

---
 tests/overlay/081 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tests/overlay/081 +6 -2
index 2270a047..bef54470 100755
@@ -14,6 +14,11 @@ _begin_fstest auto quick
 . ./common/filter
 . ./common/attr
 
+# Unique fsid mount options (uuid=null/auto/on) were added in kernel
+# v6.6 and have no module parameter; the probe mount in this helper
+# _notrun's when the kernel is too old.
+_require_scratch_overlay_features uuid
+
 
 _scratch_mkfs >>$seqres.full 2>&1
 
@@ -36,8 +41,7 @@ lower_fsid=$(stat -f -c '%i' $lowerdir)
 	echo "lower fs and upper fs fsid differ"
 
 # Test legacy behavior - ovl fsid inherited from upper fs
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o uuid=null 2>/dev/null || \
-	_notrun "Overlayfs does not support unique fsid feature"
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o uuid=null
 
 # Lookup of test_dir marks upper root as "impure", so following (uuid=auto) mounts
 # will NOT behave as first time mount of a new overlayfs
Signature · 1 line
2.55.0
Reviewed-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] overlay/081: require uuid via _require_scratch_overlay_features

Quoted 8 lines · Prabhakar Pujeri

The ad-hoc check hid the mount output and treated any mount failure as 'overlayfs does not support uuid'. Route the requirement through the generalized helper instead: the probe mount still rejects on a pre-6.6 kernel with EINVAL, and the options check remains via mount options.

---

Thanks for following up on this.
You may add

after fixing the nit below

Quoted 8 lines
 tests/overlay/081 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tests/overlay/081 +0 -0
index 2270a047..bef54470 100755

tests/overlay/081 _begin_fstest auto quick · line 19

Quoted 6 lines
tests/overlay/081 +3 -0
@@ -14,6 +14,11 @@ _begin_fstest auto quick
 . ./common/filter
 . ./common/attr
 
+# Unique fsid mount options (uuid=null/auto/on) were added in kernel
+# v6.6 and have no module parameter; the probe mount in this helper
+# _notrun's when the kernel is too old.

This is really too much of a comment.
It should be pretty clear to test writers what's the purpose of _require_ and the v6.6 information is already written in the test description less than 10 lines above.

Thanks,
Amir.

Quoted 18 lines
tests/overlay/081 +3 -3
+_require_scratch_overlay_features uuid
+
 
 _scratch_mkfs >>$seqres.full 2>&1
 
@@ -36,8 +41,7 @@ lower_fsid=$(stat -f -c '%i' $lowerdir)
        echo "lower fs and upper fs fsid differ"
 
 # Test legacy behavior - ovl fsid inherited from upper fs
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o uuid=null 2>/dev/null || \
-       _notrun "Overlayfs does not support unique fsid feature"
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o uuid=null
 
 # Lookup of test_dir marks upper root as "impure", so following (uuid=auto) mounts
 # will NOT behave as first time mount of a new overlayfs
--

2.55.0