Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2023 10:48:53 GMT
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 31a252876889 - main - stress2: Add UFS+SU test scenario
Message-ID:  <202302141048.31EAmr1L028790@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by pho:

URL: https://cgit.FreeBSD.org/src/commit/?id=31a2528768894c46751974b7efbbfb3db0f01c5e

commit 31a2528768894c46751974b7efbbfb3db0f01c5e
Author:     Peter Holm <pho@FreeBSD.org>
AuthorDate: 2023-02-14 10:48:18 +0000
Commit:     Peter Holm <pho@FreeBSD.org>
CommitDate: 2023-02-14 10:48:18 +0000

    stress2: Add UFS+SU test scenario
---
 tools/test/stress2/misc/creat.sh | 83 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/tools/test/stress2/misc/creat.sh b/tools/test/stress2/misc/creat.sh
new file mode 100755
index 000000000000..45f6b0f87301
--- /dev/null
+++ b/tools/test/stress2/misc/creat.sh
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2023 Peter Holm <pho@FreeBSD.org>
+#
+# 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.
+#
+
+# Demonstrate incorrect "out of inodes" message with SU enabled.
+# No issue seen with SU+J
+
+[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
+. ../default.cfg
+
+set -eu
+prog=$(basename "$0" .sh)
+log=/tmp/$prog.log
+s=0
+mount | grep -q "on $mntpoint " && umount $mntpoint
+mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart
+
+mdconfig -a -t swap -s 100m -u $mdstart
+[ $# -eq 1 ] && flags="$@" || flags="-Un"
+echo "newfs $flags /dev/md$mdstart"
+newfs $flags /dev/md$mdstart > /dev/null
+mount /dev/md$mdstart $mntpoint
+set +e
+
+ifree1=`df -i $mntpoint | tail -1 | awk '{print $7}'`
+before=`df -i $mntpoint`
+n=$(((ifree1 - 5) / 10))
+jot 10 | xargs -I% mkdir $mntpoint/%
+start=`date +%s`
+while [ $((`date +%s` - start)) -lt 60 ]; do
+	for j in `jot 10`; do
+		(
+			jot $n | xargs -P0 -I% touch $mntpoint/$j/%
+			jot $n | xargs -P0 -I% rm    $mntpoint/$j/%
+		) &
+	done 
+	wait
+done 2>&1 | tee $log | head -5
+[ -s $log ] && s=3
+jot 10 | xargs -I% rmdir $mntpoint/%
+umount $mntpoint; mount /dev/md$mdstart $mntpoint
+
+ifree2=`df -i $mntpoint | tail -1 | awk '{print $7}'`
+after=`df -i $mntpoint | tail -1`
+if [ $ifree1 -ne $ifree2 ]; then
+	echo "$before"
+	echo "$after"
+	s=1
+	ls -alsrt $mntpoint | head -20
+fi
+
+umount $mntpoint
+fsck -fy /dev/md$mdstart > $log 2>&1
+grep -Eq "WAS MODIFIED" $log && { s=2; cat $log; }
+
+mdconfig -d -u $mdstart
+rm -f $log
+exit $s



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302141048.31EAmr1L028790>