]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
overlay: nicer report when features are not supported
authorAmir Goldstein <amir73il@gmail.com>
Fri, 1 Jun 2018 10:44:16 +0000 (13:44 +0300)
committerEryu Guan <guaneryu@gmail.com>
Thu, 7 Jun 2018 08:58:37 +0000 (16:58 +0800)
Commit ea7ad43 ("fstests: implement require of multiple overlayfs
features") changed the message when tests are not run due to missing
overlayfs feature.

Restore the check for existing module param before trying to mount
which restores the old message format, e.g.:

[not run] feature 'metacopy' not supported by overlay

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/overlay

index e99e64f4f573e621943eb077adfd94ff926e6292..b526f24d25eb181af60a3a03d35a175df7275a9f 100644 (file)
@@ -140,9 +140,6 @@ __check_scratch_overlay_feature()
        # configurable from Kconfig (the build default), by module
        # parameter (the system default) and per mount by mount
        # option ${feature}=[on|off].
-       #
-       # If the module parameter does not exist then there is no
-       # point in checking the mount option.
        local default=`_get_fs_module_param ${feature}`
        [ "$default" = Y ] || [ "$default" = N ] || \
                _notrun "feature '${feature}' not supported by ${FSTYP}"
@@ -164,12 +161,16 @@ _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"
                opts+=",${feature}=on"
        done
 
        _scratch_mkfs > /dev/null 2>&1
        _try_scratch_mount -o $opts || \
-               _notrun "overlay options '$opts' cannot be enabled on ${SCRATCH_DEV}"
+               _notrun "overlay features '${features[*]}' cannot be enabled on ${SCRATCH_DEV}"
 
        for feature in ${features[*]}; do
                __check_scratch_overlay_feature ${feature}