From nobody Thu Jul 06 09:15:33 2023 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 4QxW8k1dnrz4l8VL; Thu, 6 Jul 2023 09:15:34 +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 4QxW8j6Tslz3NKb; Thu, 6 Jul 2023 09:15:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688634933; 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=Ovi2zYjSwjAPsQQWso/AcfECrkjesQBxNvfX2dgyaZs=; b=sFn5l3TgrxvvFypB2LgXLWMmvJrdvwM12orjrdTDrfIueOEvSnKMmIZnG13igYdIrOfzIR F351ajctTxIeqDfQdjOxCY4C/XybpsNzqfj5aWKGSjwHWnRtHTKa0k8V35wOSaZSyqxtmk PYuShZok9VxyeY8GjgFhJFuT0F6Tn2OSltycqN2es8d0ijRXZIgyxOHNPaa/RWwyzJNK3T CLyZjJsxLIEmYhOjpvtKokR7qkpwBvNbUMYHjktcW6kL7ciGcksvAdmFx79bUpxzdK/cVB 7lahTcLAYg4PX1WA5fYMwIJKmxhdoXiRGgdXIxkHSeOJkLYCNxgyYX9wGgK6Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688634933; 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=Ovi2zYjSwjAPsQQWso/AcfECrkjesQBxNvfX2dgyaZs=; b=Hz7z1aQ44qS22H1nQ8YSJJ0FrbDJ4NsOW5YVVFAH2aKvB433Jb3x2rFogUlzEuNRgag9yq IY7/T4xZAPzHEJclHL6rzWw3UBt3ZoiefLAJ2pKBekCwji6VDwz6/JpIm3lqg2DXSUWNIJ /TmvN2DF5jgIg5+Z6zkbSAE7Hh/9vIOmaxss0PhWtyR4krH8Jl7xAy+hHUw3achLHz9hEE OsmqTjZ+ZnvvSw7r0/Vd9fApmJcUOOJ6MlCBtHPAU8dVXCF2FSwjg7GuCEQo4mq/B3eEFE A+RWimC9WslEVFNHzhRQl/H/GJyXPNV5S25Sq02FfOrLhVX0vCfqvX99/rZD3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688634933; a=rsa-sha256; cv=none; b=UifL37OS1ji3mck5x/mo/rJSlz7yCBUTteZ8SgX9XOgrZtmF885uV7SapsyNYfUgsBenuH 0dYOGwna4EDs0bX7G1jcRfxt+lbNv2KsnUUl5VAXAcjyERzrzTlXqwYbr1JAwFeXnsMC+I sgNYaw5tVPsawacvfuWr2TRP0TYknt9bnEYLO6BzDcOvcJ64KIGXg3zRe9mYcK/OHARk8t n5f8tFIf64pm2aAyILOE6/3+uMDPzwUjVyG2Yw1tJWqLfpIcXQ4gbjrB5T+hit7abIHgPY YL7mBWD4oLV0OKxVyh2tSDM0C2GCjbzj3an0VD8uzd8P7+1dw0th1Nwem74p0Q== 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 4QxW8j5XwZzrKZ; Thu, 6 Jul 2023 09:15:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3669FXZT071715; Thu, 6 Jul 2023 09:15:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3669FXw4071714; Thu, 6 Jul 2023 09:15:33 GMT (envelope-from git) Date: Thu, 6 Jul 2023 09:15:33 GMT Message-Id: <202307060915.3669FXw4071714@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: 4631191c8a5f - main - stress2: Added a regression test 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: 4631191c8a5f934f5d9ddcf555fa4e59f7d8911a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=4631191c8a5f934f5d9ddcf555fa4e59f7d8911a commit 4631191c8a5f934f5d9ddcf555fa4e59f7d8911a Author: Peter Holm AuthorDate: 2023-07-06 09:15:13 +0000 Commit: Peter Holm CommitDate: 2023-07-06 09:15:13 +0000 stress2: Added a regression test --- tools/test/stress2/misc/nullfs30.sh | 112 ++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/tools/test/stress2/misc/nullfs30.sh b/tools/test/stress2/misc/nullfs30.sh new file mode 100755 index 000000000000..8b8f35aed4c0 --- /dev/null +++ b/tools/test/stress2/misc/nullfs30.sh @@ -0,0 +1,112 @@ +#!/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. +# + +# Parallel mount and umount test of file mounts, +# mounting over non-directories + +# panic: free: address 0xffffffff80b229b4 ... has not been allocated +# https://people.freebsd.org/~pho/stress/log/log0454.txt + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +cont=/tmp/nullfs30.continue +mounts=3 # Number of parallel scripts + +set -eu +md1=$mdstart +md2=$((md1 + 1)) +mp1=$mntpoint$md1 +mp2=$mntpoint$md2 +mkdir -p $mp1 $mp2 + +mdconfig -a -t swap -s 256m -u $md1 +newfs $newfs_flags -n md$md1 > /dev/null +mount /dev/md$md1 $mp1 +mdconfig -a -t swap -s 256m -u $md2 +newfs $newfs_flags -n md$md2 > /dev/null +mount /dev/md$md2 $mp2 + +for i in `jot $mounts`; do + cp /etc/group $mp1/f$i + touch $mp2/m$i +done +set +e + +mount -t nullfs $mp1/f1 $mp2/m1 || { + umount $mp2 + umount $mp1 + mdconfig -d -u $md2 + mdconfig -d -u $md1 + echo "File mount not implemented" + exit 0 +} + +(cd ../testcases/swap; ./swap -t 5m -i 20 > /dev/null) & + +# Start the parallel tests +touch $cont +while [ -f $cont ]; do + while mount | grep -q "on $mp2/m1 "; do umount $mp2/m1; done 2> /dev/null + mount -t nullfs $mp1/f1 $mp2/m1 +done & +while [ -f $cont ]; do + while mount | grep -q "on $mp2/m2 "; do umount $mp2/m2; done 2> /dev/null + mount -t nullfs $mp1/f2 $mp2/m2 +done & +while [ -f $cont ]; do + while mount | grep -q "on $mp2/m3 "; do umount $mp2/m3; done 2> /dev/null + mount -t nullfs $mp1/f3 $mp2/m3 +done & + +start=`date +%s` +while [ $((`date +%s` - start)) -lt 300 ]; do + cat $mp2/m1 $mp2/m2 $mp2/m3 > /dev/null +done +rm -f $cont +while pgrep -q swap; do pkill swap; done +wait + +for i in 1 2 3; do + while mount | grep -q "on $mp2/m$i "; do umount $mp2/m$i; done 2> /dev/null +done + +# Check error handling +mount -t nullfs $mp1/f1 $mp2/m1 +mount -t nullfs $mp1/f1 $mp2/m1 2>/dev/null && s=1 || s=0 +while mount | grep -q "on $mp2/m1 "; do umount $mp2/m1; done 2> /dev/null + +mkdir $mp2/dir +mount -t nullfs $mp1/f1 $mp2/dir 2>/dev/null && s=2 + +umount $mp2 +umount $mp1 +mdconfig -d -u $md2 +mdconfig -d -u $md1 +exit $s