From nobody Sat Nov 27 10:57:35 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DBCE118B0BA7; Sat, 27 Nov 2021 10:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J1T8v2z1zz3rJD; Sat, 27 Nov 2021 10:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 465181AAC9; Sat, 27 Nov 2021 10:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ARAvZaG043080; Sat, 27 Nov 2021 10:57:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ARAvZAH043079; Sat, 27 Nov 2021 10:57:35 GMT (envelope-from git) Date: Sat, 27 Nov 2021 10:57:35 GMT Message-Id: <202111271057.1ARAvZAH043079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 7184e8c21107 - main - Keep running fsck_ffs as long as "WAS MODIFIED" is reported List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7184e8c211074db57865adabf41a08a50d155582 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638010655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmsWKELms284eJ6saF7EOO02J3sbq844Uuz/Shif6+I=; b=h+KNH3ugmiJgGzzF9jPd21ABa6Z8+KZlKmDzs/Fg2Bjvc6zdCR8/iWw140RwGXwRZMrhiK ou+AAQXrrUVuDNoDdK6Akf6/DH1UkIGiAIeLNuXPIYHV6TxBupLEESJJ65s+jog38SPkoc lPNPsharHOIwAUaIOH+SAfqe1BR31XUIyCq3AKZS+CQxpol0PPQGUut/xiYGymF0nfDRhW SASASFl1X9e9wCkO7qdn8xoHgn7vfEjv7OpDvcWXnvHTLgtKogL9B2s+2tLzxXgyjuRT5S UaRXFMCaRlqCwVnCv2fChCQpEvQA8+GsB/ynoqPWEQUXyx9YXtdTGZ4oMLVHSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638010655; a=rsa-sha256; cv=none; b=rvWaGNCkl9WtO2m5RBnWrwgOwg2D0RRQjrJ3Lo4/Epq+I91sbM86D4+Z77DzS3vMGzbJxx lizTm+Cs/0roYaEf+tvaM6NQsooY2lfw3ZnaNzlHRlZD5MBslu/1FAwtFa/axTii5BrFBr m04/kiezbAQe+v3b8JCe6yqh+6jS8djmDJ7RfIwvCsk4sJ8qCpzBKl+enluqfN1RpMotbg ix6g/k2p7QjCmKatRYmQKSallykZBJiUZcLXajwtZq2wUTZXA4zwcu9GCEZLN7tu7W+w8s B/UiJluu8EBQubMBUpjqZYpqaDmZFPMeVBU/zXiL5+RvliAWSMduZ6+FqbGyUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=7184e8c211074db57865adabf41a08a50d155582 commit 7184e8c211074db57865adabf41a08a50d155582 Author: Peter Holm AuthorDate: 2021-11-27 10:54:53 +0000 Commit: Peter Holm CommitDate: 2021-11-27 10:54:53 +0000 Keep running fsck_ffs as long as "WAS MODIFIED" is reported --- tools/test/stress2/misc/fsck.sh | 79 ++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 33 deletions(-) diff --git a/tools/test/stress2/misc/fsck.sh b/tools/test/stress2/misc/fsck.sh index a007e722988e..826c31f733c3 100755 --- a/tools/test/stress2/misc/fsck.sh +++ b/tools/test/stress2/misc/fsck.sh @@ -27,14 +27,15 @@ # SUCH DAMAGE. # -# fsck_ffs(8) test. +# fsck_ffs(8) disk image fuzz test. + # "UFS /dev/md11 (/mnt11) cylinder checksum failed" seen. # Fixed by r341510. # 'panic: invalid counts on struct mount' seen: # https://people.freebsd.org/~pho/stress/log/fsck-4.txt -[ $DEBUG ] || exit 0 # Still WiP +# "panic: softdep_load_inodeblock: negative i_effnlink" seen. . ../default.cfg @@ -42,11 +43,6 @@ cc -o /tmp/flip -Wall -Wextra -O2 ../tools/flip.c || exit 1 -echo 'int sync(void) { return (0); }' > /tmp/fsck_preload.c -mycc -o /tmp/fsck_preload.so -shared -fpic /tmp/fsck_preload.c || exit 1 -cc -o /tmp/fsck_preload.so -shared -fpic /tmp/fsck_preload.c || exit 1 -rm /tmp/fsck_preload.c - set -e u1=$mdstart u2=$((mdstart + 1)) @@ -69,7 +65,7 @@ set +e mount | grep "on $mp1 " | grep -q /dev/md && umount -f $mp1 [ -c /dev/md$u1 ] && mdconfig -d -u $u1 mdconfig -a -t swap -s 1g -u $u1 -newfs $newfs_flags /dev/md$u1 > /dev/null +newfs $newfs_flags -n /dev/md$u1 > /dev/null mount /dev/md$u1 $mp1 [ -c /dev/md$u2 ] && mdconfig -d -u $u2 @@ -85,15 +81,16 @@ umount $mp2 chk() { local i - LD_PRELOAD=/tmp/fsck_preload.so \ - fsck_ffs -fy $1 > $log 2>&1 + clean=0 + rerun=0 + waccess=0 + fsck_ffs -fy $1 > $log 2>&1 r=$? if grep -qE "Cannot find file system superblock|Superblock check-hash failed" $log; then for b in $backups; do echo "Using alternate SB $b" asbs=$((asbs + 1)) - LD_PRELOAD=/tmp/fsck_preload.so \ - fsck_ffs -b $b -fy $1 > $log 2>&1 + fsck_ffs -b $b -fy $1 > $log 2>&1 r=$? grep -qE "Cannot find file system superblock|Superblock check-hash failed" $log || break @@ -103,47 +100,63 @@ chk() { usedasb=0 fi LANG=C egrep -q "[A-Z][A-Z]" $log && clean=0 - ! grep -Eq "IS CLEAN|MARKED CLEAN" $log; clean=$? - ! grep -q RERUN $log; rerun=$? - ! grep -q "NO WRITE ACCESS" $log; waccess=$? + grep -Eq "IS CLEAN|MARKED CLEAN" $log && clean=1 + # For now regard a "was modified" as a cause for a rerun, + # disregarding "clean" claim. + grep -Eq "WAS MODIFIED" $log && rerun=1 + grep -q RERUN $log && rerun=1 + grep -q "NO WRITE ACCESS" $log && waccess=1 [ $r -ne 0 -a $clean -eq 1 ] && echo "Exit code $r w/ clean == 1" - } -cd /tmp +cd $mp1 s=0 start=`date +%s` while [ $((`date +%s` - start)) -lt 60 ]; do - gzip < $diskimage > $backup - fsync $backup; sync # ; sleep .2; sync; sleep .2; sync mount /dev/md$u2 $mp2 || { s=101; break; } + ls -lR $mp2 > /dev/null || { s=102; echo "ls failed"; break; } touch $mp2/`jot -rc 8 a z | tr -d '\n'` - umount $mp2 - /tmp/flip -n 4 $diskimage + while mount | grep -q "on $mp2 "; do umount $mp2; done + echo * | grep -q core && break + sync + mdconfig -d -u $u2 + /tmp/flip -n 10 $diskimage + + sync + gzip < $diskimage > $backup + fsync $backup + for i in `jot 3`; do - chk /dev/md$u2 - [ $clean -eq 1 ] && { cleans=$((cleans + 1)); break; } + chk $diskimage [ $rerun -eq 1 ] && { reruns=$((reruns + 1)); continue; } + [ $clean -eq 1 ] && { cleans=$((cleans + 1)); break; } + [ -f fsck_ffs.core ] && + { cp $diskimage \ + /tmp/fsck_ffs.core.diskimage.`date +%Y%m%dT%H%M%S`; break 2; } done + [ $clean -ne 1 ] && break + mdconfig -a -t vnode -f $diskimage -u $u2 [ $r -ne 0 -a $clean -eq 1 ] && { echo "CLEAN && non zero exit code"; break; } [ $clean -eq 1 ] && continue - [ $usedasb -eq 1 ] && { echo "Alt. SB failed"; s=103; } - [ $waccess -eq 1 ] && { echo "No write access"; s=555; } + [ $usedasb -eq 1 ] && { echo "Alt. SB failed"; s=104; } + [ $waccess -eq 1 ] && { echo "No write access"; s=105; } break done -[ $DEBUG ] && - echo "$cleans cleans, $reruns reruns, $asbs alternate SBs." && cat $log +mount | grep -q "on $mp2 " && umount $mp2 +mdconfig -d -u $u2 || exit 1 + +echo "$cleans cleans, $reruns reruns, $asbs alternate SBs." if [ $clean -ne 1 ]; then echo "FS still not clean. Last fsck_ffs exit code was $r." cat $log - cp -v $log /tmp || rm $log - [ $s -eq 0 ] && s=104 + cp -v $log /tmp + [ $s -eq 0 ] && s=106 fi -mdconfig -d -u $u2 || exit 1 -[ -f fsck_ffs.core ] && ls -l fsck_ffs.core - +echo * | grep -q core && { ls -l *.core; cp $log /tmp; exit 106; } || + rm -f $backup +cd /tmp umount $mp1 mdconfig -d -u $u1 -rm -f /tmp/fsck_preload.so $backup /tmp/flip +rm -f /tmp/flip exit $s