From nobody Tue Jan 03 09:34:48 2023 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 4NmSHs0KkVz2pH3Y; Tue, 3 Jan 2023 09:34:49 +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 4NmSHr7148z4FCq; Tue, 3 Jan 2023 09:34:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672738489; 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=Lso+RaWfDfEsWwEpN8aN+GiNPcfEwYeIibo27A0RZZM=; b=cJcMPz+/wZGlrwZQvwr9ya+7WHTuEVzouKRZ7y4Yine8D/Lm5swxIoLUYBlGmtieJbvg4O 16iGrTcajutkMMCxLVVUiUsC7d5mvmTuzfe3PM+maLTcO6mCC+3/p+cZSNyWNvSo4jcXH/ YBY1MF4LxD0+bl1VVPMdko/Yw8SAwAtdPp72zn6YJgndGM+tay5PzopXWlfYOf2ewa3o99 K4oGy91whE6DDaKNMdOpC9YU9B9RrvxR5/8eXmC3AquxN77zd+oP4+lIlqA55LZP+JQzYB reaZz956vO1z27H7H+N21MN3sEudU0SOnD9x8MpMy/IfRXrgnQaw2qk31c3SDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672738489; 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=Lso+RaWfDfEsWwEpN8aN+GiNPcfEwYeIibo27A0RZZM=; b=w0RFA/HM7SzPGuQ2UaaUuHMTzNI+8ndqkDL4nNzykZnyCx03yg/mguHlyjOXfWpgVEIofP lb8B4klyqHEI1xB2yBUpnCK+LmK+LgSC/eOs0aN/dTD9Wmhf6A8R/nKS52VYi57Z2fjjiy Z/CJYRjO5fsSADpyRjH7ACAx1hvxX1cpTHg6b3Ax73BWKMxODI5ZrmWjAsprA2sRwBqhIV RDU5o2Mx5+uGVsuj7Tx+WxFdLVsxHyxDOcxVIjnpfaYlqYHjYFwtRk97ZLwEj5xfwcJGKT 8Kyf1vpuaLLkJ/egPgvH8Om4Od/ydc1zxYOKg8Li28uUwrydKQ7rc2CoC+agUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672738489; a=rsa-sha256; cv=none; b=ScDY15LV/Pb5ciFFW+x95Dj8N6cYhyLMJD+QfI92lNOKSiQQ6vkya82yDsmvN+LCIa9EX6 y3g4Rvih5inMfgiZ8I+aUg96D9cLTI33cdlvyB8paGVHbw3xh/pMhoKNKLG8Jwl+hcduvE iJzEeqX3E493bgP/7sSkOteZ8EoUkSUJo21jvSxdUyGl1HjJwAlI9gT985n+Y0MNvvNvBQ xUExD0D8EGNBL/GEhzxHSPX8MfVkKyDFDRcOCxRTInYritvxOA8xvPdbm7TDp2BjGDnjp/ FpPKFjwWZo/zRH4HebAbL2VaQeuxaCWSEnmjW7i0pgExsPINKRxH80iQ1RaiCg== 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 4NmSHr64XczRgg; Tue, 3 Jan 2023 09:34:48 +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 3039YmVj002556; Tue, 3 Jan 2023 09:34:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3039YmCL002555; Tue, 3 Jan 2023 09:34:48 GMT (envelope-from git) Date: Tue, 3 Jan 2023 09:34:48 GMT Message-Id: <202301030934.3039YmCL002555@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: 17edacfb6e7c - main - stress2: Added a regression test 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: 17edacfb6e7cf7b5bf7678968038955d29293aef Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=17edacfb6e7cf7b5bf7678968038955d29293aef commit 17edacfb6e7cf7b5bf7678968038955d29293aef Author: Peter Holm AuthorDate: 2023-01-03 09:34:00 +0000 Commit: Peter Holm CommitDate: 2023-01-03 09:34:00 +0000 stress2: Added a regression test --- tools/test/stress2/misc/growfs2.sh | 65 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/tools/test/stress2/misc/growfs2.sh b/tools/test/stress2/misc/growfs2.sh new file mode 100755 index 000000000000..0990f71423a3 --- /dev/null +++ b/tools/test/stress2/misc/growfs2.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2023 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. +# + +# growfs(8) test with output to FS to be grown. +# A regression test for D37896 ufs/suspend: deny suspension if calling +# process has file from mp opened for write +# Before D37896 this would result in growfs(8) hanging. + +. ../default.cfg +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +log=/tmp/growfs2.sh.log +s=0 +set -eu +mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 32g -u $mdstart +/sbin/gpart create -s GPT md$mdstart > /dev/null +/sbin/gpart add -t freebsd-ufs -s 2g -a 4k md$mdstart > /dev/null +set +e + +newfs $newfs_flags md${mdstart}p1 > /dev/null +mount /dev/md${mdstart}p1 $mntpoint +cp -r /usr/include $mntpoint/inc1 + +gpart resize -i 1 -s 31g -a 4k md$mdstart +echo "Expect: growfs: UFSSUSPEND: Resource deadlock avoided" +growfs -y md${mdstart}p1 > $mntpoint/log && s=1 || s=0 + +cp -r /usr/include $mntpoint/inc2 +umount $mntpoint +fsck -fy /dev/md${mdstart}p1 > $log 2>&1 +grep -q "WAS MODIFIED" $log && s=2 +grep -q CLEAN $log || s=3 +[ $s -ne 0 ] && cat $log + +mdconfig -d -u $mdstart +rm -f $log +exit $s