]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/251: skip this test if fstrim geometry detection fails
authorDarrick J. Wong <djwong@kernel.org>
Wed, 21 May 2025 22:42:23 +0000 (15:42 -0700)
committerZorro Lang <zlang@kernel.org>
Fri, 23 May 2025 13:43:29 +0000 (21:43 +0800)
There's no reason to wait until fstrim_loop to detect the length
constraints on the FITRIM call since failing to detect any constraints
just leads to _notrun.  Run that stuff from the top level scope so that
we don't start up a bunch of exercisers for no good reason.

Cc: fstests@vger.kernel.org # v2023.10.29
Fixes: 95b0db739400c2 ("generic/251: check min and max length and minlen for FSTRIM")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/251

index 644adf07cc42d5e46554136c79541d7a0517fa4f..1fb26f4caa37326275c4882990b985cbed2a994a 100755 (executable)
@@ -103,11 +103,6 @@ fstrim_loop()
        # always remove the $tmp.fstrim_loop file on exit
        trap "_destroy_fstrim; exit \$status" 2 15 EXIT
 
-       set_minlen_constraints
-       set_length_constraints
-       echo "MINLEN max=$FSTRIM_MAX_MINLEN min=$FSTRIM_MIN_MINLEN" >> $seqres.full
-       echo "LENGTH max=$FSTRIM_MAX_LEN min=$FSTRIM_MIN_LEN" >> $seqres.full
-
        fsize=$(_discard_max_offset_kb "$SCRATCH_MNT" "$SCRATCH_DEV")
 
        while true ; do
@@ -177,6 +172,12 @@ function run_process() {
 
 nproc=$((4 * LOAD_FACTOR))
 
+# Discover the fstrim constraints before we do anything else
+set_minlen_constraints
+set_length_constraints
+echo "MINLEN max=$FSTRIM_MAX_MINLEN min=$FSTRIM_MIN_MINLEN" >> $seqres.full
+echo "LENGTH max=$FSTRIM_MAX_LEN min=$FSTRIM_MIN_LEN" >> $seqres.full
+
 # Use fsstress to create a directory tree with some variability
 content=$SCRATCH_MNT/orig
 mkdir -p $content