common: print hints for reasons of test failures
authorAmir Goldstein <amir73il@gmail.com>
Tue, 19 Apr 2022 12:56:37 +0000 (15:56 +0300)
committerZorro Lang <zlang@kernel.org>
Mon, 2 May 2022 04:15:52 +0000 (12:15 +0800)
Introduce helpers _fixed_by_{kernel,git}_commit() and
_fixed_in_{kernel_,}version() that can be used to hint testers why a
test might be failing and aid in auto-generating of expunge lists for
downstream kernel testing.

A test may be annotated with multiple hints, for example:

_fixed_by_kernel_commit 09889695864 xfs: foo
_fixed_by_kernel_commit 46464565465 ext4: bar
_fixed_in_version xfsprogs v5.15

Annotate fix kernel commits for some overlayfs tests.
Annotate fix kernel version for some overlayfs tests testing
for legacy behavior whose fixes are not likely to be backported
to stable kernels.

This is modeled after LTP's 'make filter-known-fails' and
print_failure_hints() using struct tst_tag annotations.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
28 files changed:
check
common/preamble
common/rc
tests/overlay/009
tests/overlay/010
tests/overlay/014
tests/overlay/016
tests/overlay/017
tests/overlay/018
tests/overlay/020
tests/overlay/022
tests/overlay/029
tests/overlay/038
tests/overlay/041
tests/overlay/042
tests/overlay/043
tests/overlay/044
tests/overlay/054
tests/overlay/055
tests/overlay/063
tests/overlay/065
tests/overlay/067
tests/overlay/070
tests/overlay/071
tests/overlay/072
tests/overlay/074
tests/overlay/077
tests/overlay/078

diff --git a/check b/check
index a08631213cbb004db5b0febed885ad06331b0a12..de11b37e1346806d80158521b28a1752aeb63092 100755 (executable)
--- a/check
+++ b/check
@@ -808,7 +808,7 @@ function run_section()
                fi
 
                # really going to try and run this one
-               rm -f $seqres.out.bad
+               rm -f $seqres.out.bad $seqres.hints
 
                # check if we really should run it
                _expunge_test $seqnum
@@ -942,6 +942,14 @@ function run_section()
                        fi; } | sed -e 's/^\(.\)/    \1/'
                        err=true
                fi
+               if [ -f $seqres.hints ]; then
+                       if $err; then
+                               echo
+                               cat $seqres.hints
+                       else
+                               rm -f $seqres.hints
+                       fi
+               fi
        done
 
        # make sure we record the status of the last test we ran.
index 64d793850718b490c11978dbab51a597689128eb..6821966099321b5856fb119899a17f23fcdb0bf3 100644 (file)
@@ -79,6 +79,6 @@ _begin_fstest()
        . ./common/rc
 
        # remove previous $seqres.full before test
-       rm -f $seqres.full
+       rm -f $seqres.full $seqres.hints
 
 }
index eda5fcff34a0c2986a1b988a51e695c2332db4ee..e907e3629da1d4de9422d93fb8689b9472f1648f 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1610,6 +1610,35 @@ _supported_fs()
                _notrun "not suitable for this filesystem type: $FSTYP"
 }
 
+_fixed_in_version()
+{
+       local pkg=$1
+       local ver=$2
+
+       echo "HINT: You _MAY_ be hit by a known issue on $pkg version < $ver." >> $seqres.hints
+       echo >> $seqres.hints
+}
+
+_fixed_in_kernel_version()
+{
+       _fixed_in_version kernel $*
+}
+
+_fixed_by_git_commit()
+{
+       local pkg=$1
+       shift
+
+       echo "HINT: You _MAY_ be missing $pkg fix:" >> $seqres.hints
+       echo "      $*" >> $seqres.hints
+       echo >> $seqres.hints
+}
+
+_fixed_by_kernel_commit()
+{
+       _fixed_by_git_commit kernel $*
+}
+
 _check_if_dev_already_mounted()
 {
        local dev=$1
index 94bd1b66c20d061a165a81feb27a7882c3cb9014..d85ef16e4de371f965312fce9e117c15f920fba3 100755 (executable)
@@ -17,6 +17,9 @@ _begin_fstest auto quick
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_by_kernel_commit a4859d75944a \
+       "ovl: fix dentry leak for default_permissions"
+
 _require_scratch
 
 # Remove all files from previous tests
index 71ef6ec1e1025a6a46a9f03042620bfaee2a2bc6..af22b2b403db6624e68bc49930baec74e8afb793 100755 (executable)
@@ -17,6 +17,9 @@ _begin_fstest auto quick whiteout
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_by_kernel_commit 84889d493356 \
+       "ovl: check dentry positiveness in ovl_cleanup_whiteouts()"
+
 # Use non-default scratch underlying overlay dirs, we need to check
 # them explicity after test.
 _require_scratch_nocheck
index 83295cccc35d0f954a960ec7c48e662a035a260f..2d6c11d99f3d3f0f575b81b93a4ba43e7fa73301 100755 (executable)
@@ -21,6 +21,8 @@ _begin_fstest auto quick copyup
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_by_kernel_commit 0956254a2d5b "ovl: don't copy up opaqueness"
+
 # Use non-default scratch underlying overlay dirs, we need to check
 # them explicity after test.
 _require_scratch_nocheck
index 8a091615a9da881f039309588c45ab4f494c2a26..7b4a3dad56655fdaf110325190626208d055ae1e 100755 (executable)
@@ -6,7 +6,7 @@
 #
 # Test ro/rw fd data inconsistecies
 #
-# This simple test demonstrates a known issue with overlayfs:
+# This simple test demonstrates an issue with overlayfs on kernel < v4.19:
 # - process A opens file F for read
 # - process B writes new data to file F
 # - process A reads old data from file F
@@ -19,6 +19,8 @@ _begin_fstest auto quick copyup
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_in_kernel_version "v4.19"
+
 _require_scratch
 _require_xfs_io_command "open"
 
index 15b0d613fac0ff5ad5b30ccb276726e1c9b72792..0bb248c25fcb43806c714842f8a8c7deedb21117 100755 (executable)
@@ -6,7 +6,7 @@
 #
 # Test constant inode numbers
 #
-# This simple test demonstrates a known issue with overlayfs:
+# This simple test demonstrates an issue with overlayfs on kernel < v4.14:
 # - stat file A shows inode number X
 # - modify A to trigger copy up
 # - stat file A shows inode number Y != X
@@ -23,6 +23,8 @@ _begin_fstest auto quick copyup redirect
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_in_kernel_version "v4.14"
+
 _require_scratch
 _require_test_program "af_unix"
 _require_test_program "t_dir_type"
index b09bca9cf6d45012145299bc09df5512c29d7305..4cccbbdc6ad9a18487dd56497b52131190121804 100755 (executable)
@@ -6,7 +6,7 @@
 #
 # Test hardlink breakage
 #
-# This simple test demonstrates a known issue with overlayfs:
+# This simple test demonstrates an issue with overlayfs on kernel < v4.13:
 # - file A and B are hardlinked in lower
 # - modify A to trigger copy up
 # - file A is no longer a hardlink of file B
@@ -19,6 +19,8 @@ _begin_fstest auto quick copyup hardlink
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_in_kernel_version "v4.13"
+
 _require_scratch
 _require_scratch_feature index
 _require_test_program "t_dir_type"
index 51f97ccdfda0e2f5d4e05156e798fa41f22c5cdc..98a33aec23f7f27b19e16511fb541dc17a77cae4 100755 (executable)
@@ -23,6 +23,9 @@ require_unshare() {
 
 # Modify as appropriate.
 _supported_fs overlay
+_fixed_by_kernel_commit 3fe6e52f0626 \
+       "ovl: override creds with the ones from the superblock mounter"
+
 _require_scratch
 require_unshare -m -p -U
 
index 1a11805d4a03e8dd708ef2dfd11d96d198748d7b..09af6500ca2a7d61a0f72eba6457fc1eaf059d70 100755 (executable)
@@ -29,6 +29,8 @@ _cleanup()
 
 # Modify as appropriate.
 _supported_fs overlay
+_fixed_by_kernel_commit 76bc8e2843b6 "ovl: disallow overlayfs as upperdir"
+
 _require_scratch
 
 # Remove all files from previous tests
index 1a532c2a281f053360b0fc123f1d8b8435165577..c4c8eed77c449690123f6138b4843a5b83345bda 100755 (executable)
@@ -34,6 +34,8 @@ _cleanup()
 
 # Modify as appropriate.
 _supported_fs overlay
+_fixed_by_kernel_commit c4fcfc1619ea "ovl: fix d_real() for stacked fs"
+
 _require_scratch
 
 # Remove all files from previous tests
index 145b4b34c8ead7c8da026f6199920ecd9b38c9c7..19c000ceeba7990c58b535fb25ef9df236247731 100755 (executable)
@@ -15,6 +15,8 @@ _begin_fstest auto quick copyup
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_in_kernel_version "v4.14"
+
 # Use non-default scratch underlying overlay dirs, we need to check
 # them explicity after test.
 _require_scratch_nocheck
index 762e7389eb5a14ea422b3715f1c0e98fadac268d..a326b6b0a853cc035258fb306ebc9b966376897f 100755 (executable)
@@ -17,6 +17,8 @@ _begin_fstest auto quick copyup nonsamefs
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_in_kernel_version "v4.17"
+
 # Use non-default scratch underlying overlay dirs, we need to check
 # them explicity after test.
 _require_scratch_nocheck
index 60f4b477e2c75669a7cf0ff81ca6e0a40eec8be8..0715066feeec44f7b13a1a86ddb82f7af09d0e4e 100755 (executable)
@@ -26,6 +26,9 @@ _begin_fstest auto quick copyup hardlink
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_by_kernel_commit 6eaf011144af \
+       "ovl: fix EIO from lookup of non-indexed upper"
+
 _require_scratch
 # Without overlay index feature hardlinks are broken on copy up
 _require_scratch_feature index
index 383151dddcf034da6518e0e13ce1eca5a6b82440..56f8921401a84070efab2f396fcb9ff293fc211b 100755 (executable)
@@ -8,7 +8,7 @@
 # This is a variant of overlay/017 to test constant st_ino numbers for
 # non-samefs setup.
 #
-# This simple test demonstrates a known issue with overlayfs:
+# This simple test demonstrates an issue with overlayfs on kernel < v4.17:
 # - stat file A shows inode number X
 # - modify A to trigger copy up
 # - stat file A shows inode number Y != X
@@ -25,6 +25,8 @@ _begin_fstest auto quick copyup nonsamefs
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_in_kernel_version "v4.17"
+
 # Use non-default scratch underlying overlay dirs, we need to check
 # them explicity after test.
 _require_scratch_nocheck
index 3f54b7eae738b92f3a48d13827a9700cb79cdc96..3f74890fa4175385b865cb959e80089488fabf38 100755 (executable)
@@ -7,7 +7,7 @@
 # Test hardlink breakage on non-samefs setup
 # This is a variant of overlay/018 to test.
 #
-# This simple test demonstrates a known issue with overlayfs:
+# This simple test demonstrates an issue with overlayfs on kernel < v4.17:
 # - file A and B are hardlinked in lower
 # - modify A to trigger copy up
 # - file A is no longer a hardlink of file B
@@ -20,6 +20,8 @@ _begin_fstest auto quick copyup hardlink nonsamefs
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_in_kernel_version "v4.17"
+
 # Use non-default scratch underlying overlay dirs, we need to check
 # them explicity after test.
 _require_scratch_nocheck
index d95427b61e890005a48a17b56fa1a67160ad7e85..ba20a7fc8aacc742c7726415e75eea288393a6e2 100755 (executable)
@@ -37,6 +37,9 @@ _begin_fstest auto quick copyup redirect exportfs
 # real QA test starts here
 
 _supported_fs overlay
+_fixed_by_kernel_commit 2ca3c148a062 \
+       "ovl: check lower ancestry on encode of lower dir file handle"
+
 _require_scratch
 _require_test_program "open_by_handle"
 # We need to require all features together, because nfs_export cannot
index 45a3c107458c944fff9f0f9c82b45822db6fe090..367f038b2ff08ecefa07a9dec714de10ba734c6c 100755 (executable)
@@ -46,6 +46,9 @@ _cleanup()
 # real QA test starts here
 
 _supported_fs overlay
+_fixed_by_kernel_commit 2ca3c148a062 \
+       "ovl: check lower ancestry on encode of lower dir file handle"
+
 _require_test
 _require_test_program "open_by_handle"
 # Use non-default scratch underlying overlay dirs, we need to check
index 94726000be5b10901bd7805bc4f30a13fd700b84..f7bd46e493848ea4f16d1d247e98f54b65ad37c6 100755 (executable)
@@ -17,6 +17,9 @@ _begin_fstest auto quick whiteout
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_by_kernel_commit 5e1275808630 \
+       "ovl: check whiteout in ovl_create_over_whiteout()"
+
 _require_scratch
 
 # Remove all files from previous tests
index 5f3fe097efd40108aa7557ea916fcef4ca849665..e1bed4c7b173d2125d4eab45a1528323983b6b23 100755 (executable)
@@ -38,6 +38,10 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_in_kernel_version "v5.2"
+_fixed_by_kernel_commit 0be0bfd2de9d \
+       "ovl: fix regression caused by overlapping layers detection"
+
 # Use non-default scratch underlying overlay dirs, we need to check
 # them explicity after test.
 _require_scratch_nocheck
index 7dddb2652afc3a48cd8118436b4b2903c8747553..3f54a418d84dd75ad0857d27419524e1846b7498 100755 (executable)
@@ -20,6 +20,9 @@ _begin_fstest auto quick copyup nonsamefs
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_by_kernel_commit 9c6d8f13e9da \
+       "ovl: fix corner case of non-unique st_dev;st_ino"
+
 # Use non-default scratch underlying overlay dirs, we need to check
 # them explicity after test.
 _require_scratch_nocheck
index d433279afeeec4bd9b99eb5748933ac40c91997d..a4ec2f0329d8d7fb4106c58ff8cdc4f585df1ff7 100755 (executable)
@@ -8,7 +8,7 @@
 # nested overlay setup, where all layers of both overlays are on the
 # same fs.
 #
-# This simple test demonstrates a known issue with overlayfs:
+# This simple test demonstrates an issue with overlayfs on kernel < v4.17:
 # - stat file A shows inode number X
 # - modify A to trigger copy up
 # - stat file A shows inode number Y != X
@@ -35,6 +35,8 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_in_kernel_version "v4.17"
+
 _require_scratch_nocheck
 _require_test_program "af_unix"
 _require_test_program "t_dir_type"
index 2ef2836968ff67177ef5a8bd37834a14029fed61..c22e3880dbcc96853e49e87a570eacd9c7251182 100755 (executable)
@@ -7,7 +7,7 @@
 # This is a variant of overlay/017 to test constant st_ino numbers for
 # nested overlay setup, where lower overlay layers are not on the same fs.
 #
-# This simple test demonstrates a known issue with overlayfs:
+# This simple test demonstrates an issue with overlayfs on kernel < v4.17:
 # - stat file A shows inode number X
 # - modify A to trigger copy up
 # - stat file A shows inode number Y != X
@@ -38,6 +38,8 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_in_kernel_version "v4.17"
+
 _require_test
 _require_scratch_nocheck
 _require_test_program "af_unix"
index bdb608ffd419652e876621d7460bb8e74a2818d1..6f5e77df45c433969c7c88cff277d524e1d06364 100755 (executable)
@@ -28,6 +28,8 @@ _begin_fstest auto quick copyup hardlink
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_by_kernel_commit 83552eacdfc0 "ovl: fix WARN_ON nlink drop to zero"
+
 _require_scratch
 
 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
index 833e791917574baaa14ce5e356d614ac777de637..d3738649718a64e846c67ffef242d4cf0b567e92 100755 (executable)
@@ -22,6 +22,11 @@ _begin_fstest auto quick exportfs dangerous
 # real QA test starts here
 
 _supported_fs overlay
+_fixed_by_kernel_commit 144da23beab8 \
+       "ovl: return required buffer size for file handles"
+_fixed_by_kernel_commit 9aafc1b01873 \
+       "ovl: potential crash in ovl_fid_to_fh()"
+
 _require_scratch
 _require_test_program "open_by_handle"
 # We need to require all features together, because nfs_export cannot
index d22a1a94ac7b255cc71416a471ddb0be8d97a07a..702ff54c5c4c0bcc4c24c91a6ee6b9d1e9315571 100755 (executable)
@@ -18,6 +18,11 @@ _begin_fstest auto quick dir
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_by_kernel_commit 65cd913ec9d9 \
+       "ovl: invalidate readdir cache on changes to dir with origin"
+_fixed_by_kernel_commit 9011c2791e63 \
+       "ovl: skip stale entries in merge dir cache iteration"
+
 _require_scratch_nocheck
 
 # Use small getdents bufsize to fit less than 10 entries
index 9e9be03f6ab2840570d30e2c75ed60f4ece93f89..3c15f4b76e8882128fec3d226eb8633cb927285d 100755 (executable)
@@ -33,6 +33,7 @@ _cleanup()
 
 # real QA test starts here
 _supported_fs overlay
+_fixed_in_kernel_version "v5.13"
 
 _require_command "$LSATTR_PROG" lasttr
 _require_command "$CHATTR_PROG" chattr