From: Darrick J. Wong Date: Wed, 21 May 2025 22:42:23 +0000 (-0700) Subject: generic/251: skip this test if fstrim geometry detection fails X-Git-Tag: v2025.05.25~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=34d0c55a92b5b637f49b4b90591c8db29cf396cd;p=xfstests-dev.git generic/251: skip this test if fstrim geometry detection fails 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 Reviewed-by: Christoph Hellwig Signed-off-by: Zorro Lang --- diff --git a/tests/generic/251 b/tests/generic/251 index 644adf07..1fb26f4c 100755 --- a/tests/generic/251 +++ b/tests/generic/251 @@ -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