From nobody Fri Mar 4 11:07:59 2022 X-Original-To: dev-commits-src-main@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 39B9B19FC804; Fri, 4 Mar 2022 11:08:00 +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 4K94p80yHWz4l3N; Fri, 4 Mar 2022 11:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646392080; 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=ZeSxD5qYOmDN46f9A+mO3lVEFhYYV6WFg2HSJ0o4AbA=; b=PaI6XltUYvum5ShYdLsNoYNgGZ8uThu5PwMInT0NO9K9Kmr+dLtiSxtTZfx7hPOYrb6G/W +m0dwFuPKrxA9w8rXHGbDfLioq2uFD6IPkfNw8bIECOCvlb77kWWoRdDY6kOQ3ZdoroxVs 4Ihs31uubHQrXozIXno9tlSjotXLgDNQ1kN54MlbNtb4n6ILsvLGUQ3pwlgGo9gTaqrkoV VI+qPFKmFUZWOBDbV91P+2VoGPH5+ChMFd1sCshKFZIegXBrRkoWoSheWk794K8hzF48Uv Vf/c2yHbF5k2NyDJDwOa8yoyVb3IfrFp/ldsBDiWIkUYSwEe86apmozJFXO/DA== 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 0057B2D0F; Fri, 4 Mar 2022 11:08:00 +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 224B7xIp067282; Fri, 4 Mar 2022 11:07:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 224B7xIU067281; Fri, 4 Mar 2022 11:07:59 GMT (envelope-from git) Date: Fri, 4 Mar 2022 11:07:59 GMT Message-Id: <202203041107.224B7xIU067281@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: 205117128771 - main - stress2: Added a new test scenario checing for a long fsck_ffs runtime List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 205117128771033174b18d79a14d3c6f7dc195cc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646392080; 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=ZeSxD5qYOmDN46f9A+mO3lVEFhYYV6WFg2HSJ0o4AbA=; b=W+Wh0e+tdT//SDlIlqYgvshxZ+c048SHm9sM2yBKqmhkzFpy3DnWAckjwpeFz2hVBUye72 MsO73VB1ANWpKxKiwN+z9WS3tSekMth+Vl/4FU98sZQdYLcIiHdRcD3wCFbNYjDZdpyc6U nm5yoxWGgGeThJf1VKmPf9A/QndfUHA9lJneaWlVROFtjgkdJAQJINU1jPzRxyHWg62x04 WkhOmSKPHSb2op567pnD2vfMDEr50TMBMPp4kbbCFKe8L0HoGQBXxaDs/ApLGHcWh4sAPc s0BFuvw6JVLN5Dz+o+U8E7LTgV+tsQAYzLX9OWmNLlWW8wO58jMBNCHLXq5vmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646392080; a=rsa-sha256; cv=none; b=ry2d4LiRrLY1HZ5ZIPXzGtSyqRZx3n0CQlLJDK48s499elRw9FTANpjvcHF/vwVZAEapfR SbDQguFOxbTRgjWJzrNdYnKG9iFZOksMZRf8Dvi64CxaC9gm5cc4DsgjOjZUeCoBEEzXrM cWpXsn1yG2Ub9QFQO0febEWp6mMQ/WNE2eNAugcBR1J3DQDY9MNwlOUM3fqpt0xaEYDTXd VkBuvmzQiIhbx2Jy207BqApoYWnVb41LysPGOlUA3RALrBs8WgXrd54I96fSanvjJ229hH tRR3rXC6lOQuZNu6/TqRtkaD7poVSLD8MuX1lHRa4d9SBeFQpFfbT2YImtPjFA== 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=205117128771033174b18d79a14d3c6f7dc195cc commit 205117128771033174b18d79a14d3c6f7dc195cc Author: Peter Holm AuthorDate: 2022-03-04 11:06:45 +0000 Commit: Peter Holm CommitDate: 2022-03-04 11:06:45 +0000 stress2: Added a new test scenario checing for a long fsck_ffs runtime --- tools/test/stress2/misc/gnop12.sh | 114 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/tools/test/stress2/misc/gnop12.sh b/tools/test/stress2/misc/gnop12.sh new file mode 100755 index 000000000000..d22a82b35a7e --- /dev/null +++ b/tools/test/stress2/misc/gnop12.sh @@ -0,0 +1,114 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2022 Peter Holm +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# fsck test with forced unmount of a SU FS. +# Variation of gnop8.sh by Kirk McKusick + +# Long fsck_ffs runtime scenario + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +fsck=/sbin/fsck_ffs +fsck_loops=10 +log=/tmp/gnop12.log +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 5g -u $mdstart || exit 1 +md=md$mdstart +newfs -U /dev/$md > /dev/null 2>&1 || exit 1 + +export LOAD=80 +export rwLOAD=80 +export runRUNTIME=10m +export RUNDIR=$mntpoint/stressX +export CTRLDIR=$mntpoint/stressX.control +export MAXSWAPPCT=80 +export TESTPROGS=' +testcases/creat/creat +' + +start=`date +%s` +while [ $((`date +%s` - start)) -lt 600 ]; do + gnop create /dev/$md || exit 1 + mount /dev/$md.nop $mntpoint || exit 1 + + rm -rf $RUNDIR $CTRLDIR + mkdir -p $RUNDIR $CTRLDIR + chmod 777 $RUNDIR $CTRLDIR + set `df -ik $mntpoint | tail -1 | awk '{print $4,$7}'` + export KBLOCKS=$(($1 / 10 * 7)) + export INODES=$(($2 / 10 * 7)) + + su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' > /dev/null 2>&1 & + + # after some number of seconds + sleep `jot -r 1 20 30` + gnop destroy -f /dev/$md.nop + ../tools/killall.sh || exit 1 + while pgrep -qU $testuser; do pkill -U $testuser; done + wait + + # Wait until forcible unmount, may be up to about 30 seconds, + # but typically very quick if I/O is in progress + s=`date +%s` + n=0 + while mount | grep -q "on $mntpoint "; do + [ $n -eq 0 ] && /bin/echo -n "Waiting for $mntpoint to force umount ..." + n=$((n + 1)) + sleep 5 + if [ $((`date +%s` - s)) -ge 180 ]; then + echo "Giving up on waiting for umount of $mntpoint" + umount $mntpoint + while mount | grep -q "on $mntpoint "; do + umount -f $mntpoint + done + fi + done + [ $n -ne 0 ] && echo + + # The initial fsck_ffs may run for more than on hour with a 5GB MD disk + t=`date +%s` + $fsck -fy /dev/$md > /dev/null 2>&1 + t=$((`date +%s`- t)) + [ $t -gt 300 ] && { echo "First fsck took $(((t + 30) / 60)) minutes!"; e=1; } + + for i in `jot $fsck_loops`; do + sleep 10 + $fsck -fy /dev/$md > $log 2>&1 + # For now, do not trust fsck_ffs's "CLEAN" message +# grep -Eq "IS CLEAN|MARKED CLEAN" $log && break + grep -Eq "FILE SYSTEM WAS MODIFIED" $log || break + [ $i -eq $fsck_loops ] && + { echo "$fsck did not mark FS as clean"; tail -12 $log; exit 1; } + done +done +$fsck -fy /dev/$md > $log || { tail -5 $log; exit 1; } +mdconfig -d -u ${md#md} +rm -f $log +exit $e