From bb1f64b200b59672059088c0ed369b3225f2632e Mon Sep 17 00:00:00 2001 From: Peter Holm Date: Wed, 22 Mar 2023 10:05:46 +0100 Subject: [PATCH] stress2: Fix syntax error. Remove redundant backup --- tools/test/stress2/misc/fsck11.sh | 4 ++-- tools/test/stress2/misc/fsck12.sh | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/test/stress2/misc/fsck11.sh b/tools/test/stress2/misc/fsck11.sh index cb5d1d256be6..8019cc1f2656 100755 --- a/tools/test/stress2/misc/fsck11.sh +++ b/tools/test/stress2/misc/fsck11.sh @@ -56,7 +56,7 @@ reruns=0 newfs_flags=$(echo "" "-U" "-O1" | awk -v N=`jot -r 1 1 3` '{print $N}') [ $# -eq 1 ] && newfs_flags="$1" # or use script argument max=$((2 * 1024 * 1024)) -[ "$newfs_flags" == "-j" ] && max=$((20 * 1024 * 1024)) # Make room for the journal file +[ "$newfs_flags" = "-j" ] && max=$((20 * 1024 * 1024)) # Make room for the journal file mount | grep "on $mp1 " | grep -q /dev/md && umount -f $mp1 [ -c /dev/md$u1 ] && mdconfig -d -u $u1 @@ -135,7 +135,7 @@ while [ $((`date +%s` - start)) -lt 300 ]; do fsync $backup sync; sleep 1 - [ $newfs_flags == "-j" ] && + [ "$newfs_flags" = "-j" ] && fsck -fy $diskimage > $log 2>&1 # process the journal file for i in `jot 5`; do [ $i -gt 2 ] && echo "fsck run #$i" diff --git a/tools/test/stress2/misc/fsck12.sh b/tools/test/stress2/misc/fsck12.sh index d2787e962927..da4629991705 100755 --- a/tools/test/stress2/misc/fsck12.sh +++ b/tools/test/stress2/misc/fsck12.sh @@ -60,7 +60,7 @@ mount /dev/md$u1 $mp1 newfs_flags='-j' [ $# -eq 1 ] && newfs_flags="$1" # or use script argument max=$((2 * 1024 * 1024)) -[ "$newfs_flags" == "-j" ] && max=$((20 * 1024 * 1024)) # Make room for the journal file +[ "$newfs_flags" = "-j" ] && max=$((20 * 1024 * 1024)) # Make room for the journal file [ -c /dev/md$u2 ] && mdconfig -d -u $u2 dd if=/dev/zero of=$diskimage bs=$max count=1 status=none @@ -141,7 +141,7 @@ while [ $((`date +%s` - start)) -lt 300 ]; do fsync $backup sync; sleep 1 - [ $newfs_flags == "-j" ] && + [ $newfs_flags = "-j" ] && fsck -fy $diskimage > $log 2>&1 # process the journal file for i in `jot 5`; do [ $i -gt 2 ] && echo "fsck run #$i" @@ -150,9 +150,7 @@ while [ $((`date +%s` - start)) -lt 300 ]; do grep -q "MODIFIED" $log && continue # For now, do not trust CLEAN [ $clean -eq 1 ] && { cleans=$((cleans + 1)); break; } if [ -f fsck_ffs.core ]; then - tstamp=`date +%Y%m%dT%H%M%S` - gzip < $backup > /tmp/fsck_ffs.core.diskimage.$tstamp.gz - gzip < fsck_ffs.core > /tmp/fsck_ffs.core.$tstamp.gz + s=1 break 2 fi done