]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
fuzzy: stop __stress_scrub_fsx_loop if fsx fails
authorDarrick J. Wong <djwong@kernel.org>
Mon, 3 Feb 2025 22:00:30 +0000 (14:00 -0800)
committerZorro Lang <zlang@kernel.org>
Tue, 18 Feb 2025 04:42:39 +0000 (12:42 +0800)
Stop the fsx scrub stress loop if fsx returns a nonzero error code.

Cc: <fstests@vger.kernel.org> # v2023.01.15
Fixes: a2056ca8917bc8 ("fuzzy: enhance scrub stress testing to use fsx")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/fuzzy

index aa6c7a863833c1583012030dbd3136e5122e5f68..16ec7172947a604a7f7c75af37bb15990a630145 100644 (file)
@@ -942,6 +942,7 @@ __stress_scrub_fsx_loop() {
        local remount_period="$3"
        local stress_tgt="$4"   # ignored
        local focus=(-q -X)     # quiet, validate file contents
+       local res
 
        # As of November 2022, 2 million fsx ops should be enough to keep
        # any filesystem busy for a couple of hours.
@@ -993,7 +994,9 @@ __stress_scrub_fsx_loop() {
                # Need to recheck running conditions if we cleared anything
                __stress_scrub_clean_scratch && continue
                $here/ltp/fsx $args >> $seqres.full
-               echo "fsx exits with $? at $(date)" >> $seqres.full
+               res=$?
+               echo "fsx exits with $res at $(date)" >> $seqres.full
+               test "$res" -ne 0 && break
        done
        rm -f "$runningfile"
 }