From nobody Mon Jan 30 08:33:26 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 4P51fZ4JyYz3bv79; Mon, 30 Jan 2023 08:33:26 +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 4P51fZ3K9cz3j0X; Mon, 30 Jan 2023 08:33:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675067606; 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=DzelP66H+XazsBKlW5xHuWqth2YAdQgqDCfdpJ4K/wE=; b=ft3ARLIJPoQQPPfjNrFeSZCBGWGZGb781qJmiQwGDVuMENL7hlkrHjmN5oy4pm/5Nabd1s 1SXpWQnNPuf56D9dhAgmbJxAC3X0oRxcZF5niKymwS9jv/6d9fZFP9EnwkwJHCV3vafxl6 9ROjKn+GUMJt6ADxm/xXR8SOjlgUJusrObRt69VXPEzdcGP+45PnoLKndQTfdbhRc9/d1C 68ctEL9KYl800jO1q0Y2P3KGIU/CvVIJ7G9TiAQBxdtIJFuu3pAkVq72Nas/yMuwq/Hl8z q4wx9ec8TUyF/CmcKf8JZMQwK0i8mCXaActZ8sjqsuTmaSfB1Q5xnhbA9NZQOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675067606; 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=DzelP66H+XazsBKlW5xHuWqth2YAdQgqDCfdpJ4K/wE=; b=JdOjoiK3hnmpNRKbHWXn5S8PizT82TysPDqgOkrB1wOixTV5nOWlOHREMP2E/CkjWAzatX l94nIucPOmIo0TrrFNcZEcd7HHnxC7W9fNvpAmoOmkHZVQ/yTSek5Tj322d38zZTCVygMe /+eKsHJcqOxxSbp13gSvSL4yDj2F/cwo9vwBiiC4kkhJezsHKTtW4VE7ZYdttGYAHNu4VF cH2ahgzczsMNnDv5p+j5Zz7E4AHZfFQYt1tXTaoZFPv+oJBJpMq94YPOJLHKsQcmgLEw6z WX9TibNRnbIa23fpCttjX+PyZDMPfPHsKWCjFUn9PV4a6jS9+q9q+h1/F9493g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675067606; a=rsa-sha256; cv=none; b=IVaG3qloxHnJTY0op481YlKV7mWKuUfqVcozGcYoxWpkB7spyXeq/KvXbqhbiEwlflf2An Zk4TTagdCsgw4Jq9sXmKKX9i24mnLS4nGalyYeRs2EoVKd6E51JoEu1gEq1Nwb1YL+H/4c DIev/kLCLlW4TXKelyP3GM/tclEcgjJZlr9egoAxSj+iZp4eCSA84lUKjqek8X7aKwFWzM JcOO20g3+FFWrPwqhH17ZnM+tWZvy94aBJ5o9LOacsIEFHjQvV257b/Q763qdyBhWDHhzp Xn4b9ux+XXq4sU3GoGB/z00WUioY9nCqfKNMibOxjvhHW0msUKRwTWjTwiC7vA== 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 4P51fZ2LJQz11mn; Mon, 30 Jan 2023 08:33:26 +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 30U8XQ7n058021; Mon, 30 Jan 2023 08:33:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30U8XQb3058019; Mon, 30 Jan 2023 08:33:26 GMT (envelope-from git) Date: Mon, 30 Jan 2023 08:33:26 GMT Message-Id: <202301300833.30U8XQb3058019@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: 349aac52ac19 - main - stress2: Added a test scenario for "out of inodes" issue with UFS+SU 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: 349aac52ac1921af6c51deda8c23b12515d8f855 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=349aac52ac1921af6c51deda8c23b12515d8f855 commit 349aac52ac1921af6c51deda8c23b12515d8f855 Author: Peter Holm AuthorDate: 2023-01-30 08:28:37 +0000 Commit: Peter Holm CommitDate: 2023-01-30 08:28:37 +0000 stress2: Added a test scenario for "out of inodes" issue with UFS+SU --- tools/test/stress2/misc/mkdir.sh | 75 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/tools/test/stress2/misc/mkdir.sh b/tools/test/stress2/misc/mkdir.sh new file mode 100755 index 000000000000..155de9b61cc6 --- /dev/null +++ b/tools/test/stress2/misc/mkdir.sh @@ -0,0 +1,75 @@ +#!/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. +# + +# Demonstrate incorrect "out of inodes" message with SU enabled. +# No issue without SU. + +[ `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 +jot 10 | xargs -I% mkdir $mntpoint/% +set +e + +ifree1=`df -i $mntpoint | tail -1 | awk '{print $7}'` +before=`df -i $mntpoint` +n=$(((ifree1 - 5) / 10)) +for i in `jot 5`; do + for j in `jot 10`; do + jot $n | xargs -P0 -I% mkdir $mntpoint/$j/% + jot $n | xargs -P0 -I% rmdir $mntpoint/$j/% + done +done 2>&1 | head -5 +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