From patchwork Wed Nov 27 04:51:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886541 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D31759450 for ; Wed, 27 Nov 2024 04:54:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683250; cv=none; b=Jkdj1gkRCe9Le0p7GtI3Hj17RfVoEkguEO1h6uBJ+DlJ9heT2kF4ohPNr49kJgpJ7cggFhUGp4nQGccJe2NtodUC25AmQWX7ZiORjRyJyy7ajOaAOCZ84ah/iIu91kG8CDDMpgLkvzLeWBttIY/1f9oS2qTp0R7RhHUgSZRVw4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683250; c=relaxed/simple; bh=X7p3I2aHwuiVgGyGN04fkwzDteLgOvI9SR2LOGUklWw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AOWXo76UbRI6YkkCsyXC1ZdrLpHdtEai55waSsn8s6HSpzrdxe1I8g1nTo1akiKaUXp2Ugu9fohUerPiZVET1E7jO+3vYxZDEa8K/BlOYY31EspWzj6bgnUjVCqvNEtC1710Osi4yXlt2XyLxdD1/3YMQtrGEB1IPxjlsORq2sI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=oaOFi2eF; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="oaOFi2eF" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-7ae3d7222d4so5212956a12.3 for ; Tue, 26 Nov 2024 20:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683248; x=1733288048; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=nw/JbaFyOQ36Z7Twm3eM/DwgLcrXScvc9zCjUac6R2c=; b=oaOFi2eF5GQkYqa08nokNsrlvgloBAWpTGhB+3cZE9A6+ffFt5yGH3B3VmomN2pWwC bZMI9jhlEbEjRRO9LcxHOGW1zDb9T7kzgfQPTG0AhBJjH4X5FAz/bFrOpcfb/cCZxv9K /CTWBIHcYygfwMdsSXUMUektuBTSXdDj7A3J8D2GP1lxKbkgQcQaWoTTXs0ICY8N1XeO ANJbRUvfc++vwrBfhMWQJ1Qv7OD/crBRdIe6LufZWCXaddRjUm6Xc5q+0OKPrGo3mnRT fWIOzrFEFsLx6A04xXGl/t7zySXU0EqmJU0bqW8AXrh8c/9Y6+7jeYBco/6XvsriRose AtoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683248; x=1733288048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nw/JbaFyOQ36Z7Twm3eM/DwgLcrXScvc9zCjUac6R2c=; b=O0fe1KlJimYLCUBWhHFX6WQkqE5QKNzXaViopRmdCEbRZB5IJvRd3qSNE9PTLxyRXe VsD88cDhKbxuTVjQOLfnPg8GqmaEvZyw13wt7Ml9uTwg7ZLOp90cdd4ghwTUxoupRCzE aPRUa7ld+xSc6tAZiXK6tgotuO5uAMYEY8f5/LAIV4zFkIXtzWacuFVPG7nTA1u3ivD/ eBm7jQ7WrR+YROaJUsIIbFfs0pgTO/QjB2UZSpU+IZC6PFn2RPwEW9ErsguvQs7ohJ5O cgcltBtT+5Vg1yFwIsoayvi99B+HAMWQBARL6Xpbs2jeW0OLJMID+VPlWHBdy1v4cgpZ bt2A== X-Gm-Message-State: AOJu0YwMm5vHAlyjuWf3NIjpp2ABmpKAusLIcexc9j4wkYen3aNq/8cp MVLuphX1w9vI+wqwIAa9iD3qDU9HxecqZUFcglo9emvXRZd33EzZV0GNTaPjBprD6ITghTfMtDo Y X-Gm-Gg: ASbGncsNWrwZodW25z35KKy63rrja4XQyzbORagjQJaB/++iNG8Zwq2EVynk4tbO1Hw Iw+l+RD3gwNZ7CxYApHKS8sLneXyrefJnMn2WC9NPL94FNdlqC/cX0BcSmflYvLMLH+V/bFyAOt nAKA8HOpyslpb5otxBOGjh0eP0YKYdK8gWmOoEekYT4RUybZNpGJQsGdEV34O5jrwZavKDa2R5M BS1ox8bqwi5Da9btiBUMVv+AIx0+0InLKhl9s10PgT0P4BeQ8n23meYUDyFZnUy796003mArSWO 8kMpqV29iZs64aeDwUJXVkU3 X-Google-Smtp-Source: AGHT+IGTWw4FbN1JQuEGO2BNM0MwBbNFtkZ3/1hkvId9VARq7AOL6GfW8lWdJmuaixBntrLnPh/xGw== X-Received: by 2002:a05:6a21:4610:b0:1db:e5ac:3d5b with SMTP id adf61e73a8af0-1e0e0b8cc45mr2570924637.39.1732683248024; Tue, 26 Nov 2024 20:54:08 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dc2024asm93523495ad.224.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:07 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3w-00000003ZTs-2k3w for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:04 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3w-0000000FQdW-3GQv for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:04 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 01/40] xfs/448: get rid of assert-on-failure Date: Wed, 27 Nov 2024 15:51:31 +1100 Message-ID: <20241127045403.3665299-2-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner The bug this problem exercises has been fixed for quite some time, but the test does not run on XFS debug kernels that have fatal asserts enable. There is no reason for this now that the test does not assert fail on most kernels regularly tested, so kill the check and enable the test to run on all XFS configs. Signed-off-by: Dave Chinner --- tests/xfs/448 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/xfs/448 b/tests/xfs/448 index fbd1af383..032c94d39 100755 --- a/tests/xfs/448 +++ b/tests/xfs/448 @@ -13,10 +13,6 @@ # up the directory tree by running xfs_scrub will crash the # kernel in __xfs_dir3_data_check. # -# Notice: -# we should have non fatal asserts configured, because assert -# failures triggered by the intentional corrupt would crash system. -# . ./common/preamble _begin_fstest auto quick fuzzers @@ -26,8 +22,6 @@ _begin_fstest auto quick fuzzers _require_scratch_nocheck _require_xfs_io_command "scrub" -# Corrupt XFS on purpose, and skip if assert failures would crash system. -_require_no_xfs_bug_on_assert rm -f "$seqres.full" From patchwork Wed Nov 27 04:51:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886551 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 333B66A8D2 for ; Wed, 27 Nov 2024 04:54:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683254; cv=none; b=q4S1Xh3msxR9OHEOj2srOQZi6UvPIhFZ5TweQqK3OIa/SD+H8pe/d9pCjqJkw65olhkv9Dai5ObO/50e2bGzeBLx0XrPqqnQeyQtYJ3dkmv1YcgSOvaWbH6UKRHUjbBGT8eQMwX5gaQnAuRUXJtfuTaH5e8gakur1maOIy3kX2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683254; c=relaxed/simple; bh=Q8V2xptHAtOgheYcnBgZMjz0QYavmKeu3q4+LRTqrTs=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CjLBGWSklHyYKeaID/Oa7ONjRhLjNgyFPcRTUPldYLtIY/deXmU8u0O17wzHtC/mPt1NYgNQ09TkOflq+e+ysTgwAW1VWYJHsdZ4EBucl6yzB6D+BZNxEfZ18B+IEZAmT0/to+u+NHmQB+ic5nP795LEGX/ruogN8tWTPR6DYqM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=RI2NA5DZ; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="RI2NA5DZ" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2124ccf03edso63837725ad.2 for ; Tue, 26 Nov 2024 20:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683248; x=1733288048; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ScRU/cGw3yOQE3JoeDcuSTtQ0K+BYTsyFaaoiGxZr7s=; b=RI2NA5DZ+rE19/dm3+998qVQcIByttEjlYzUj/Bz5mGQHsYOzJfJyp31GiV/Gi0Zr4 uaxx+q7+ds+3BGkHp/R7Xld3Uz8VYa2979mwHGSyHZooMH+d611o5M1fBwOiniEYUd1w UWEzdXUS7sP2EPOY22UJgihPfZ4FYJJ566SPIjwzhUyxAsPgokhA+yVQwSSDETuL/GQj BA2EaC1oKI2GuuOvCBGCSBm52z17JeVu6q11CVgomuc8EoyjVAa+MTu/w4e4h/mxm8LO QtuFi/Bx8Fvme7Pfg84KDcdrM2XHF8y78VHWIYZ94/98YBxn6OXVo676Byk9y7Y3jsdd X9sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683248; x=1733288048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ScRU/cGw3yOQE3JoeDcuSTtQ0K+BYTsyFaaoiGxZr7s=; b=D4GU4wNpKc5jS17zKvkNGsfbaVd4SmxuXNkKCYtvvOt5ddDQGjM17xn3DVHB5IYPMU IARwRfAqHZKKBIv9iHr2yqDlrR3RuomMu8FumL85G1Q3kb5EoajNfExyxC1EO5RWsQbS p2HRrt4Uat3azS6F//turiS7JUhmtk0X3WqQ5skTf4+3m86enHWcsCj2vuWYXjKyqokt 3weAiOJzFK+uOdaGXoKdDl/GkpQ27A22xA8A2xqyrrRzGnArP9D5hz1vuFCrQrwUKb3V wCt7+unlOyVFgswxqzN9JczK5rpsPxEzyd5/TYwkCb0wcnhMdtPfb/Dnc9hN7DXsRpUP w/NQ== X-Gm-Message-State: AOJu0Yx/wd6pAR7aUhgBQrpC0uy63lfgZHhSO52mXBjp7fbWTamTnyhB 10tTT4FHF4WYIThJyAMtTrlsOEQZ5Ez6Njjm3dTIO9HgkNlqh9wd+Lu4ROJxdtalziY1o5vHNCY u X-Gm-Gg: ASbGncvPcgr41edtllWjue1uE2QDZsCp+RUdESo29yCorwmXe1iwbSx/xHz1hHnB+2m h1K5mC/LEZqr7x8MO8qAhAvaE2UpT6BxOjsbFsJSa/lA2gt0NiF07/UJHeAkgnr5LUIKXMsVfTP obdlwJU+5KJPQzB5mDl6X2ZWOSuCBmGp/bpM6dSMhXoa3X+DVum4vwp35tjtIvdeIWzT0KtkAE0 coJIsMCocwYVfi8kBdrTNPxDk58FMaravDJ73RtSzPygbQOlC3LnyjJ6Cv2BhS/7AY9b0IqMrvL IHEvLFHM8jFeXU3qlHi+4pxh X-Google-Smtp-Source: AGHT+IHdFeCouCaIdQqPnvcMoP5kSLQuQ6MNQUrr9VDE4yt9WiDRICccLGFQqpRdY0O9akvkYvRTkw== X-Received: by 2002:a17:902:ea04:b0:212:4751:ad7e with SMTP id d9443c01a7336-21501086e23mr17920685ad.8.1732683248352; Tue, 26 Nov 2024 20:54:08 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dbff380sm93919845ad.114.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:08 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3w-00000003ZTv-2xrw for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:04 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3w-0000000FQda-3RLw for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:04 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 02/40] fstests: cleanup fsstress process management Date: Wed, 27 Nov 2024 15:51:32 +1100 Message-ID: <20241127045403.3665299-3-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Lots of tests run fsstress in the background and then have to kill it and/or provide special cleanup functions to kill the background fsstress processes. They typically use $KILLALL_PROG for this. Use of killall is problematic for running multiple tests in parallel in that one test can kill other tests' processes. However, because fsstress itself forks and runs children, there are very few avenues for shell scripts to ensure all the fsstress processes actually die. With bash, it is especially nasty, because sending SIGTERM will result in bash outputting error messages ("Killed: ..." that will cause golden output mismatches and hence test failures. Hence we also need to be able to tell the main fstress process to die without triggering these messages. To avoid the process tracking problems, we change to use pkill rather than killall (more options for process selection) and we stop using the $here/ltp/fsstress binary. Instead, we copy the $here/ltp/fsstress to $TEST_DIR/$seq.fsstress so that the test has a unique fsstress binary name. This allows the pkill filter to select just the fsstress processes the test has run. The fsstress binary name is held in _FSSTRESS_NAME, and the program to run is _FSSTRESS_PROG. We also track the primary fsstress process ID, and store that in _FSSTRESS_PID. We do this so that we have a PID to wait against so that we don't return before the fsstress processes are dead. To this end, we add a SIGPIPE handler to the primary process so that it dying doesn't trigger bash 'killed' message output. We can send 'pkill -PIPE $_FSSTRESS_NAME' to all the fsstress processes and the primary process will then enter the "wait for children to die" processing loop before it exits. In this way, we can wait for the primary fsstress process and when it exits we know that all it's children have also finished and gone away. This makes killing fsstress invocations reliable and noise free. This is accomplished by the helpers added to common/rc: _run_fsstress _run_fsstress_bg _wait_for_fsstress _kill_fstress This also means that all fsstress invocations now obey FSSTRESS_AVOID environment restrictions, many of which didn't. We add a call to _kill_fstress into the generic _cleanup() function. This means that tests using fsstress don't need to add a special local _cleanup function just to call _kill_fsstress() so that background fsstress processes are killed when the user interrupts the tests with ctrl-c. Further, killall in the _cleanup() function is often used to attempt to expedite killing of foreground execution fsstress processes. This doesn't actually work because of the way bash processes interupt signals. That is, it waits for the currently executing process to finish execution, then runs the trap function. Hence a foreground fsstress won't ever be interrupted by ctrl-c. By implementing _run_fsstress() as a background process and a wait call, the wait() call is interrupted by the signal and the cleanup trap is run immediately. Hence the fsstress processes are killed immediately and the test exits cleanly almost immediately. The result of all this is common, clean handling of fsstress execution and termination. There are a few exceptions for special cases, but the vast majority of tests that run fsstress use the above four wrapper functions exclusively. Signed-off-by: Dave Chinner --- common/fuzzy | 28 ++++++++++---------- common/preamble | 1 + common/rc | 59 +++++++++++++++++++++++++++++++++++++++++++ ltp/fsstress.c | 16 +++++++++--- tests/btrfs/004 | 11 ++++---- tests/btrfs/007 | 3 ++- tests/btrfs/012 | 4 +-- tests/btrfs/028 | 6 ++--- tests/btrfs/049 | 4 +-- tests/btrfs/057 | 4 +-- tests/btrfs/060 | 14 +++------- tests/btrfs/061 | 13 +++------- tests/btrfs/062 | 13 +++------- tests/btrfs/063 | 13 +++------- tests/btrfs/064 | 13 +++------- tests/btrfs/065 | 14 +++------- tests/btrfs/066 | 14 +++------- tests/btrfs/067 | 14 +++------- tests/btrfs/068 | 14 +++------- tests/btrfs/069 | 13 +++------- tests/btrfs/070 | 13 +++------- tests/btrfs/071 | 13 +++------- tests/btrfs/072 | 14 +++------- tests/btrfs/073 | 13 +++------- tests/btrfs/074 | 13 +++------- tests/btrfs/078 | 12 ++------- tests/btrfs/100 | 4 +-- tests/btrfs/101 | 4 +-- tests/btrfs/136 | 6 ++--- tests/btrfs/192 | 11 ++++---- tests/btrfs/195 | 2 +- tests/btrfs/212 | 14 +++++----- tests/btrfs/232 | 4 +-- tests/btrfs/252 | 5 ++-- tests/btrfs/261 | 2 +- tests/btrfs/284 | 4 +-- tests/btrfs/286 | 2 +- tests/btrfs/320 | 6 ++--- tests/btrfs/332 | 4 +-- tests/ext4/004 | 4 +-- tests/ext4/057 | 14 +++------- tests/ext4/058 | 3 +-- tests/ext4/307 | 4 +-- tests/generic/013 | 22 ++++------------ tests/generic/019 | 13 +++++----- tests/generic/051 | 20 +++------------ tests/generic/055 | 6 ++--- tests/generic/068 | 7 +++-- tests/generic/070 | 12 ++------- tests/generic/076 | 10 +++----- tests/generic/076.out | 1 - tests/generic/083 | 13 ++-------- tests/generic/083.out | 1 - tests/generic/117 | 4 +-- tests/generic/232 | 5 ++-- tests/generic/232.out | 1 - tests/generic/269 | 8 +++--- tests/generic/270 | 9 ++++--- tests/generic/388 | 24 ++---------------- tests/generic/390 | 11 +++----- tests/generic/409 | 9 ++++--- tests/generic/410 | 9 ++++--- tests/generic/411 | 9 ++++--- tests/generic/461 | 15 ++--------- tests/generic/475 | 17 ++++--------- tests/generic/476 | 15 +---------- tests/generic/482 | 12 ++++----- tests/generic/547 | 5 ++-- tests/generic/560 | 7 +++-- tests/generic/561 | 17 ++++--------- tests/generic/579 | 6 ++--- tests/generic/585 | 4 +-- tests/generic/589 | 7 ++--- tests/generic/642 | 10 +------- tests/generic/648 | 19 ++++---------- tests/generic/650 | 15 ++++++----- tests/generic/750 | 10 +++----- tests/generic/753 | 17 ++++--------- tests/overlay/019 | 48 ++++++++++++++++++++++++----------- tests/overlay/021 | 8 +++--- tests/xfs/006 | 7 ++--- tests/xfs/011 | 10 +++----- tests/xfs/013 | 16 ++---------- tests/xfs/017 | 13 ++-------- tests/xfs/017.out | 1 - tests/xfs/032 | 2 +- tests/xfs/049 | 4 +-- tests/xfs/051 | 14 ++-------- tests/xfs/057 | 8 +++--- tests/xfs/077 | 2 +- tests/xfs/079 | 14 ++-------- tests/xfs/104 | 14 +++------- tests/xfs/137 | 2 +- tests/xfs/141 | 12 +-------- tests/xfs/158 | 4 +-- tests/xfs/167 | 14 +++------- tests/xfs/168 | 8 +++--- tests/xfs/264 | 4 +-- tests/xfs/270 | 2 +- tests/xfs/297 | 8 +++--- tests/xfs/305 | 8 +++--- tests/xfs/442 | 10 +------- tests/xfs/538 | 4 +-- tests/xfs/609 | 20 +++------------ tests/xfs/610 | 20 +++------------ 105 files changed, 414 insertions(+), 675 deletions(-) diff --git a/common/fuzzy b/common/fuzzy index 14d6cb104..9181520a3 100644 --- a/common/fuzzy +++ b/common/fuzzy @@ -12,13 +12,13 @@ _scratch_fuzz_modify() { echo "+++ stressing filesystem" mkdir -p $SCRATCH_MNT/data [ "$FSTYP" == "xfs" ] && _xfs_force_bdev data $SCRATCH_MNT/data - $FSSTRESS_PROG "${fsstress_args[@]}" -d $SCRATCH_MNT/data + _run_fsstress "${fsstress_args[@]}" -d $SCRATCH_MNT/data if [ "$FSTYP" = "xfs" ]; then if _xfs_has_feature "$SCRATCH_MNT" realtime; then mkdir -p $SCRATCH_MNT/rt _xfs_force_bdev realtime $SCRATCH_MNT/rt - $FSSTRESS_PROG "${fsstress_args[@]}" -d $SCRATCH_MNT/rt + _run_fsstress "${fsstress_args[@]}" -d $SCRATCH_MNT/rt else echo "+++ xfs realtime not configured" fi @@ -965,7 +965,7 @@ __stress_scrub_fsx_loop() { res=$? echo "$mode fsx exits with $res at $(date)" >> $seqres.full if [ "$res" -ne 0 ] && [ "$res" -ne 124 ]; then - # Stop if fsstress returns error. Mask off + # Stop if fsx returns error. Mask off # the magic code 124 because that is how the # timeout(1) program communicates that we ran # out of time. @@ -1096,7 +1096,7 @@ __stress_scrub_fsstress_loop() { # As of March 2022, 2 million fsstress ops should be enough to keep # any filesystem busy for a couple of hours. - local args=$(_scale_fsstress_args -p 4 -d $SCRATCH_MNT -n 2000000 "${focus[@]}" $FSSTRESS_AVOID) + local args=$(_scale_fsstress_args -p 4 -d $SCRATCH_MNT -n 2000000 "${focus[@]}") echo "Running $FSSTRESS_PROG $args" >> $seqres.full if [ -n "$remount_period" ]; then @@ -1107,17 +1107,13 @@ __stress_scrub_fsstress_loop() { # anything. test "$mode" = "rw" && __stress_scrub_clean_scratch && continue - timeout -s TERM "$remount_period" $FSSTRESS_PROG \ - $args $rw_arg >> $seqres.full + _run_fsstress_bg $args $rw_arg >> $seqres.full + sleep $remount_period + _kill_fsstress res=$? echo "$mode fsstress exits with $res at $(date)" >> $seqres.full - if [ "$res" -ne 0 ] && [ "$res" -ne 124 ]; then - # Stop if fsstress returns error. Mask off - # the magic code 124 because that is how the - # timeout(1) program communicates that we ran - # out of time. - break; - fi + [ "$res" -ne 0 ] && break; + if [ "$mode" = "rw" ]; then mode="ro" rw_arg="-R" @@ -1139,7 +1135,7 @@ __stress_scrub_fsstress_loop() { while __stress_scrub_running "$end" "$runningfile"; do # Need to recheck running conditions if we cleared anything __stress_scrub_clean_scratch && continue - $FSSTRESS_PROG $args >> $seqres.full + _run_fsstress $args >> $seqres.full echo "fsstress exits with $? at $(date)" >> $seqres.full done rm -f "$runningfile" @@ -1181,7 +1177,8 @@ _scratch_xfs_stress_scrub_cleanup() { # Send SIGINT so that bash won't print a 'Terminated' message that # distorts the golden output. echo "Killing stressor processes at $(date)" >> $seqres.full - $KILLALL_PROG -INT xfs_io fsstress fsx xfs_scrub >> $seqres.full 2>&1 + _kill_fsstress + $KILLALL_PROG -INT xfs_io fsx xfs_scrub >> $seqres.full 2>&1 # Tests are not allowed to exit with the scratch fs frozen. If we # started a fs freeze/thaw background loop, wait for that loop to exit @@ -1394,6 +1391,7 @@ _scratch_xfs_stress_scrub() { "__stress_scrub_${exerciser}_loop" "$end" "$runningfile" \ "$remount_period" "$stress_tgt" & + _FSSTRESS_PID=$! if [ -n "$freeze" ]; then __stress_scrub_freeze_loop "$end" "$runningfile" & diff --git a/common/preamble b/common/preamble index e60cd949a..78e45d522 100644 --- a/common/preamble +++ b/common/preamble @@ -7,6 +7,7 @@ # Standard cleanup function. Individual tests can override this. _cleanup() { + _kill_fsstress cd / rm -r -f $tmp.* } diff --git a/common/rc b/common/rc index 2ee46e510..391370fd5 100644 --- a/common/rc +++ b/common/rc @@ -6,6 +6,65 @@ BC="$(type -P bc)" || BC= +# Common execution handling for fsstress invocation. +# +# We need per-test fsstress binaries because of the way fsstress forks and +# tests run it in the background and/or nest it. Trying to kill fsstress +# tasks is unreliable because killing parent fsstress task does not guarantee +# that the children get killed. Hence the historic use of killall for stopping +# execution. +# +# However, we can't just kill all fsstress binaries as multiple tests might be +# running fsstress at the same time. Hence copy the fsstress binary to a test +# specific binary on the test device and use pkill to select that only that +# task name to kill. +# +# If tasks want to start fsstress themselves (e.g. under a different uid) then +# they can set up _FSSTRESS_BIN and record _FSSTRESS_PID themselves. Then if the +# test is killed then it will get cleaned up automatically. + +_FSSTRESS_BIN="$seq.fsstress" +_FSSTRESS_PROG="$TEST_DIR/$seq.fsstress" +_FSSTRESS_PID="" +_wait_for_fsstress() +{ + local ret=0 + + if [ -n "$_FSSTRESS_PID" ]; then + wait $_FSSTRESS_PID >> $seqres.full 2>&1 + ret=$? + unset _FSSTRESS_PID + fi + rm -f $_FSSTRESS_PROG + return $ret +} + +# Standard fsstress cleanup function. Individual tests can override this. +_kill_fsstress() +{ + if [ -n "$_FSSTRESS_PID" ]; then + # use SIGPIPE to avoid "Killed" messages from bash + echo "killing $_FSSTRESS_BIN" >> $seqres.full + pkill -PIPE $_FSSTRESS_BIN >> $seqres.full 2>&1 + _wait_for_fsstress + return $? + fi +} + +_run_fsstress_bg() +{ + cp -f $FSSTRESS_PROG $_FSSTRESS_PROG + $_FSSTRESS_PROG $FSSTRESS_AVOID $* >> $seqres.full 2>&1 & + _FSSTRESS_PID=$! +} + +_run_fsstress() +{ + _run_fsstress_bg $* + _wait_for_fsstress + return $? +} + _wallclock() { date "+%s" diff --git a/ltp/fsstress.c b/ltp/fsstress.c index 3d248ee25..a6840f28c 100644 --- a/ltp/fsstress.c +++ b/ltp/fsstress.c @@ -444,6 +444,7 @@ void sg_handler(int signum) { switch (signum) { case SIGTERM: + case SIGPIPE: should_stop = 1; break; case SIGBUS: @@ -469,6 +470,9 @@ keep_looping(int i, int loops) { int ret; + if (should_stop) + return false; + if (deadline.tv_nsec) { struct timespec now; @@ -732,14 +736,17 @@ int main(int argc, char **argv) perror("sigaction failed"); exit(1); } + if (sigaction(SIGPIPE, &action, 0)) { + perror("sigaction failed"); + exit(1); + } for (i = 0; i < nproc; i++) { if (fork() == 0) { sigemptyset(&action.sa_mask); - action.sa_handler = SIG_DFL; - if (sigaction(SIGTERM, &action, 0)) - return 1; action.sa_handler = sg_handler; + if (sigaction(SIGTERM, &action, 0)) + return 1; if (sigaction(SIGBUS, &action, 0)) return 1; #ifdef HAVE_SYS_PRCTL_H @@ -1196,6 +1203,9 @@ keep_running(opnum_t opno, opnum_t operations) { int ret; + if (should_stop) + return false; + if (deadline.tv_nsec) { struct timespec now; diff --git a/tests/btrfs/004 b/tests/btrfs/004 index 5a2ce9931..06eedde22 100755 --- a/tests/btrfs/004 +++ b/tests/btrfs/004 @@ -17,6 +17,7 @@ noise_pid=0 # Override the default cleanup function. _cleanup() { + _kill_fsstress rm $tmp.running wait rm -f $tmp.* @@ -159,8 +160,7 @@ workout() _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 _scratch_mount # -w ensures that the only ops are ones which cause write I/O - run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n 2000 \ - $FSSTRESS_AVOID + _run_fsstress -d $SCRATCH_MNT -w -p $procs -n 2000 _btrfs subvolume snapshot $SCRATCH_MNT \ $SCRATCH_MNT/$snap_name @@ -170,15 +170,14 @@ workout() # make some noise but ensure we're not touching existing data # extents. - run_check $FSSTRESS_PROG -d $SCRATCH_MNT -p $procs -n 4000 \ + _run_fsstress -d $SCRATCH_MNT -p $procs -n 4000 \ -z -f chown=3 -f link=1 -f mkdir=2 -f mknod=2 \ -f rename=2 -f setxattr=1 -f symlink=2 clean_dir="$SCRATCH_MNT/next" mkdir $clean_dir # now make more files to get a higher tree - run_check $FSSTRESS_PROG -d $clean_dir -w -p $procs -n 2000 \ - $FSSTRESS_AVOID + _run_fsstress -d $clean_dir -w -p $procs -n 2000 run_check _scratch_unmount _scratch_mount "-o atime" @@ -186,7 +185,7 @@ workout() # make background noise while backrefs are being walked while [ -f "$tmp.running" ]; do echo background fsstress >>$seqres.full - run_check $FSSTRESS_PROG -d $SCRATCH_MNT/bgnoise -n 999 + _run_fsstress -d $SCRATCH_MNT/bgnoise -n 999 echo background rm >>$seqres.full rm -rf $SCRATCH_MNT/bgnoise/ done & diff --git a/tests/btrfs/007 b/tests/btrfs/007 index a7eb62162..d9cc32750 100755 --- a/tests/btrfs/007 +++ b/tests/btrfs/007 @@ -18,6 +18,7 @@ _begin_fstest auto quick rw metadata send seek # Override the default cleanup function. _cleanup() { + _kill_fsstress cd / rm -f $tmp.* rm -fr $send_files_dir @@ -45,7 +46,7 @@ workout() _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 _scratch_mount "-o noatime" - run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n $ops $FSSTRESS_AVOID -x \ + _run_fsstress -d $SCRATCH_MNT -n $ops -x \ "$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base" _btrfs subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr diff --git a/tests/btrfs/012 b/tests/btrfs/012 index 5811b3b33..f41d7e4eb 100755 --- a/tests/btrfs/012 +++ b/tests/btrfs/012 @@ -45,7 +45,7 @@ mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT echo "populating the initial ext fs:" >> $seqres.full mkdir "$SCRATCH_MNT/$BASENAME" -$FSSTRESS_PROG -w -d "$SCRATCH_MNT/$BASENAME" -n 20 -p 500 >> $seqres.full +_run_fsstress -w -d "$SCRATCH_MNT/$BASENAME" -n 20 -p 500 # Create the checksum to verify later. $FSSUM_PROG -A -f -w $tmp.original "$SCRATCH_MNT/$BASENAME" @@ -74,7 +74,7 @@ umount $SCRATCH_MNT/mnt echo "Generating new data on the converted btrfs" >> $seqres.full mkdir -p $SCRATCH_MNT/new -$FSSTRESS_PROG -w -d "$SCRATCH_MNT/new" -n 20 -p 500 >> $seqres.full +_run_fsstress -w -d "$SCRATCH_MNT/new" -n 20 -p 500 _scratch_unmount diff --git a/tests/btrfs/028 b/tests/btrfs/028 index f64fc831d..85e42f31e 100755 --- a/tests/btrfs/028 +++ b/tests/btrfs/028 @@ -32,8 +32,7 @@ args=`_scale_fsstress_args -z \ -f fsync=10 -n 100000 -p 2 \ -d $SCRATCH_MNT/stress_dir` echo "Run fsstress $args" >>$seqres.full -$FSSTRESS_PROG $args >>$seqres.full & -fsstress_pid=$! +_run_fsstress_bg $args echo "Start balance" >>$seqres.full _btrfs_stress_balance -d $SCRATCH_MNT >/dev/null 2>&1 & @@ -41,8 +40,7 @@ balance_pid=$! # 30s is enough to trigger bug sleep $((30*$TIME_FACTOR)) -kill $fsstress_pid &> /dev/null -wait $fsstress_pid &> /dev/null +_kill_fsstress _btrfs_kill_stress_balance_pid $balance_pid # The qgroups accounting will be checked by 'btrfs check' (fsck) after the diff --git a/tests/btrfs/049 b/tests/btrfs/049 index 19eec7851..5c09942ee 100755 --- a/tests/btrfs/049 +++ b/tests/btrfs/049 @@ -39,7 +39,7 @@ args=`_scale_fsstress_args -z \ -f write=10 -f creat=10 \ -n 1000 -p 2 -d $SCRATCH_MNT/stress_dir` echo "Run fsstress $args" >>$seqres.full -$FSSTRESS_PROG $args >>$seqres.full +_run_fsstress $args >>$seqres.full # Start and pause balance to ensure it will be restored on remount echo "Start balance" >>$seqres.full @@ -68,7 +68,7 @@ $BTRFS_UTIL_PROG balance resume "$SCRATCH_MNT" &>/dev/null [ $? -eq 0 ] || _fail "Couldn't resume balance after device add" # Add more files so that new balance won't fish immediately -$FSSTRESS_PROG $args >/dev/null 2>&1 +_run_fsstress $args # Now pause->resume balance. This ensures balance paused is properly set in # the kernel and won't trigger an assertion failure. diff --git a/tests/btrfs/057 b/tests/btrfs/057 index 6c3999463..1e871dd1b 100755 --- a/tests/btrfs/057 +++ b/tests/btrfs/057 @@ -19,12 +19,12 @@ _scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 _scratch_mount # -w ensures that the only ops are ones which cause write I/O -run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 $FSSTRESS_AVOID +_run_fsstress -d $SCRATCH_MNT -w -p 5 -n 1000 _btrfs subvolume snapshot $SCRATCH_MNT \ $SCRATCH_MNT/snap1 -run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 $FSSTRESS_AVOID +_run_fsstress -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 _btrfs quota enable $SCRATCH_MNT _btrfs quota rescan -w $SCRATCH_MNT diff --git a/tests/btrfs/060 b/tests/btrfs/060 index 75c10bd23..21f15ec89 100755 --- a/tests/btrfs/060 +++ b/tests/btrfs/060 @@ -21,10 +21,7 @@ _cleanup() if [ ! -z "$balance_pid" ]; then _btrfs_kill_stress_balance_pid $balance_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -51,10 +48,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start balance worker: " >>$seqres.full _btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 & @@ -67,9 +63,7 @@ run_test() echo "$subvol_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt unset subvol_pid _btrfs_kill_stress_balance_pid $balance_pid diff --git a/tests/btrfs/061 b/tests/btrfs/061 index 2b3b76a7f..5a2bd7090 100755 --- a/tests/btrfs/061 +++ b/tests/btrfs/061 @@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$scrub_pid" ]; then _btrfs_kill_stress_scrub_pid $scrub_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -47,10 +44,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start balance worker: " >>$seqres.full _btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 & @@ -63,8 +59,7 @@ run_test() echo "$scrub_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_balance_pid $balance_pid unset balance_pid _btrfs_kill_stress_scrub_pid $scrub_pid diff --git a/tests/btrfs/062 b/tests/btrfs/062 index 4ab7ca534..a25d6d117 100755 --- a/tests/btrfs/062 +++ b/tests/btrfs/062 @@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$defrag_pid" ]; then _btrfs_kill_stress_defrag_pid $defrag_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -48,10 +45,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start balance worker: " >>$seqres.full _btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 & @@ -64,8 +60,7 @@ run_test() echo "$defrag_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_balance_pid $balance_pid unset balance_pid _btrfs_kill_stress_defrag_pid $defrag_pid diff --git a/tests/btrfs/063 b/tests/btrfs/063 index ea4275d29..7d51ff554 100755 --- a/tests/btrfs/063 +++ b/tests/btrfs/063 @@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$remount_pid" ]; then _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -47,10 +44,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start balance worker: " >>$seqres.full _btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 & @@ -63,8 +59,7 @@ run_test() echo "$remount_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_balance_pid $balance_pid unset balance_pid _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT diff --git a/tests/btrfs/064 b/tests/btrfs/064 index a8aa62513..3b98f327e 100755 --- a/tests/btrfs/064 +++ b/tests/btrfs/064 @@ -22,10 +22,7 @@ _cleanup() if [ ! -z "$replace_pid" ]; then _btrfs_kill_stress_replace_pid $replace_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -57,10 +54,9 @@ run_test() _scratch_mount >>$seqres.full 2>&1 SCRATCH_DEV_POOL=$saved_scratch_dev_pool - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args # Start both balance and replace in the background. # Either balance or replace shall run, the other fails. @@ -75,8 +71,7 @@ run_test() echo "$replace_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_balance_pid $balance_pid unset balance_pid _btrfs_kill_stress_replace_pid $replace_pid diff --git a/tests/btrfs/065 b/tests/btrfs/065 index b87c66d6e..f0c9ffb04 100755 --- a/tests/btrfs/065 +++ b/tests/btrfs/065 @@ -21,10 +21,7 @@ _cleanup() if [ ! -z "$replace_pid" ]; then _btrfs_kill_stress_replace_pid $replace_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -59,10 +56,9 @@ run_test() _scratch_mount >>$seqres.full 2>&1 SCRATCH_DEV_POOL=$saved_scratch_dev_pool - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start subvolume worker: " >>$seqres.full _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 & @@ -75,9 +71,7 @@ run_test() echo "$replace_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt unset subvol_pid _btrfs_kill_stress_replace_pid $replace_pid diff --git a/tests/btrfs/066 b/tests/btrfs/066 index cc7cd9b72..e3a083b94 100755 --- a/tests/btrfs/066 +++ b/tests/btrfs/066 @@ -21,10 +21,7 @@ _cleanup() if [ ! -z "$scrub_pid" ]; then _btrfs_kill_stress_scrub_pid $scrub_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -51,10 +48,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start subvolume worker: " >>$seqres.full _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 & @@ -67,9 +63,7 @@ run_test() echo "$scrub_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt unset subvol_pid _btrfs_kill_stress_scrub_pid $scrub_pid diff --git a/tests/btrfs/067 b/tests/btrfs/067 index 0b4730500..768993116 100755 --- a/tests/btrfs/067 +++ b/tests/btrfs/067 @@ -21,10 +21,7 @@ _cleanup() if [ ! -z "$defrag_pid" ]; then _btrfs_kill_stress_defrag_pid $defrag_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -52,10 +49,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start subvolume worker: " >>$seqres.full _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 & @@ -68,9 +64,7 @@ run_test() echo "$defrag_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt unset subvol_pid _btrfs_kill_stress_defrag_pid $defrag_pid diff --git a/tests/btrfs/068 b/tests/btrfs/068 index 83e932e84..3d221259f 100755 --- a/tests/btrfs/068 +++ b/tests/btrfs/068 @@ -22,10 +22,7 @@ _cleanup() if [ ! -z "$remount_pid" ]; then _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -52,10 +49,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start subvolume worker: " >>$seqres.full _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 & @@ -68,9 +64,7 @@ run_test() echo "$remount_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt unset subvol_pid _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT diff --git a/tests/btrfs/069 b/tests/btrfs/069 index 510551760..7954e80a8 100755 --- a/tests/btrfs/069 +++ b/tests/btrfs/069 @@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$scrub_pid" ]; then _btrfs_kill_stress_scrub_pid $scrub_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -55,10 +52,9 @@ run_test() _scratch_mount >>$seqres.full 2>&1 SCRATCH_DEV_POOL=$saved_scratch_dev_pool - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start replace worker: " >>$seqres.full _btrfs_stress_replace $SCRATCH_MNT >>$seqres.full 2>&1 & @@ -71,8 +67,7 @@ run_test() echo "$scrub_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_scrub_pid $scrub_pid unset scrub_pid _btrfs_kill_stress_replace_pid $replace_pid diff --git a/tests/btrfs/070 b/tests/btrfs/070 index f2e9dfcb1..c18380034 100755 --- a/tests/btrfs/070 +++ b/tests/btrfs/070 @@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$defrag_pid" ]; then _btrfs_kill_stress_defrag_pid $defrag_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -56,10 +53,9 @@ run_test() _scratch_mount >>$seqres.full 2>&1 SCRATCH_DEV_POOL=$saved_scratch_dev_pool - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start replace worker: " >>$seqres.full _btrfs_stress_replace $SCRATCH_MNT >>$seqres.full 2>&1 & @@ -72,8 +68,7 @@ run_test() echo "$defrag_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_replace_pid $replace_pid unset replace_pid _btrfs_kill_stress_defrag_pid $defrag_pid diff --git a/tests/btrfs/071 b/tests/btrfs/071 index 5c65bcfe0..5c2b725b0 100755 --- a/tests/btrfs/071 +++ b/tests/btrfs/071 @@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$remount_pid" ]; then _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -55,10 +52,9 @@ run_test() _scratch_mount >>$seqres.full 2>&1 SCRATCH_DEV_POOL=$saved_scratch_dev_pool - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start replace worker: " >>$seqres.full _btrfs_stress_replace $SCRATCH_MNT >>$seqres.full 2>&1 & @@ -71,8 +67,7 @@ run_test() echo "$remount_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_replace_pid $replace_pid unset replace_pid _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT diff --git a/tests/btrfs/072 b/tests/btrfs/072 index 0a3da5ffd..327508874 100755 --- a/tests/btrfs/072 +++ b/tests/btrfs/072 @@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$scrub_pid" ]; then _btrfs_kill_stress_scrub_pid $scrub_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -48,10 +45,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start scrub worker: " >>$seqres.full _btrfs_stress_scrub $SCRATCH_MNT >/dev/null 2>&1 & @@ -64,9 +60,7 @@ run_test() echo "$defrag_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_defrag_pid $defrag_pid unset defrag_pid _btrfs_kill_stress_scrub_pid $scrub_pid diff --git a/tests/btrfs/073 b/tests/btrfs/073 index bf7e9ca7a..b77e14c91 100755 --- a/tests/btrfs/073 +++ b/tests/btrfs/073 @@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$scrub_pid" ]; then _btrfs_kill_stress_scrub_pid $scrub_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -47,10 +44,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start scrub worker: " >>$seqres.full _btrfs_stress_scrub $SCRATCH_MNT >/dev/null 2>&1 & @@ -63,8 +59,7 @@ run_test() echo "$remount_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT unset remount_pid _btrfs_kill_stress_scrub_pid $scrub_pid diff --git a/tests/btrfs/074 b/tests/btrfs/074 index f78267159..a752707db 100755 --- a/tests/btrfs/074 +++ b/tests/btrfs/074 @@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$defrag_pid" ]; then _btrfs_kill_stress_defrag_pid $defrag_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter @@ -48,10 +45,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start defrag worker: " >>$seqres.full _btrfs_stress_defrag $SCRATCH_MNT $with_compress >/dev/null 2>&1 & @@ -64,8 +60,7 @@ run_test() echo "$remount_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT unset remount_pid _btrfs_kill_stress_defrag_pid $defrag_pid diff --git a/tests/btrfs/078 b/tests/btrfs/078 index bbebeff39..b802f9d86 100755 --- a/tests/btrfs/078 +++ b/tests/btrfs/078 @@ -16,14 +16,6 @@ . ./common/preamble _begin_fstest auto snapshot -tmp=`mktemp -d` - -# Override the default cleanup function. -_cleanup() -{ - rm -fr $tmp -} - . ./common/filter _require_scratch @@ -39,8 +31,8 @@ workout() snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT" snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`" - run_check $FSSTRESS_PROG -p $procs \ - -x "$snapshot_cmd" -X $num_snapshots -d $SCRATCH_MNT -n $ops + _run_fsstress -p $procs -x "$snapshot_cmd" -X $num_snapshots \ + -d $SCRATCH_MNT -n $ops } ops=8000 diff --git a/tests/btrfs/100 b/tests/btrfs/100 index 46bfc4f74..a319c7bbb 100755 --- a/tests/btrfs/100 +++ b/tests/btrfs/100 @@ -13,6 +13,7 @@ _begin_fstest auto replace volume eio # Override the default cleanup function. _cleanup() { + _kill_fsstress _dmerror_cleanup rm -f $tmp.* } @@ -39,8 +40,7 @@ error_devid=`$BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT |\ snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT" snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`" -run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 200 -p 8 $FSSTRESS_AVOID -x \ - "$snapshot_cmd" -X 50 +_run_fsstress -d $SCRATCH_MNT -n 200 -p 8 -x "$snapshot_cmd" -X 50 # now load the error into the DMERROR_DEV _dmerror_load_error_table diff --git a/tests/btrfs/101 b/tests/btrfs/101 index c65e14ea0..cb14d6a07 100755 --- a/tests/btrfs/101 +++ b/tests/btrfs/101 @@ -13,6 +13,7 @@ _begin_fstest auto replace volume eio # Override the default cleanup function. _cleanup() { + _kill_fsstress _dmerror_cleanup rm -f $tmp.* } @@ -40,8 +41,7 @@ error_devid=`$BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT |\ snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT" snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`" -run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 200 -p 8 $FSSTRESS_AVOID -x \ - "$snapshot_cmd" -X 50 +_run_fsstress -d $SCRATCH_MNT -n 200 -p 8 -x "$snapshot_cmd" -X 50 # now load the error into the DMERROR_DEV _dmerror_load_error_table diff --git a/tests/btrfs/136 b/tests/btrfs/136 index 2a5280fb9..65bbcf516 100755 --- a/tests/btrfs/136 +++ b/tests/btrfs/136 @@ -34,11 +34,9 @@ BTRFS_MD5SUM="$tmp.btrfs" populate_data(){ data_path=$1 mkdir -p $data_path - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $data_path` + args=`_scale_fsstress_args -p 20 -n 100 -d $data_path` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! - wait $fsstress_pid + _run_fsstress $args } # Create & populate an ext3 filesystem diff --git a/tests/btrfs/192 b/tests/btrfs/192 index f7fb65b8d..cc8e1e003 100755 --- a/tests/btrfs/192 +++ b/tests/btrfs/192 @@ -13,12 +13,12 @@ _begin_fstest auto replay snapshot stress recoveryloop # Override the default cleanup function. _cleanup() { - cd / + _kill_fsstress kill -q $pid1 &> /dev/null kill -q $pid2 &> /dev/null - "$KILLALL_PROG" -q $FSSTRESS_PROG &> /dev/null wait _log_writes_cleanup &> /dev/null + cd / rm -f $tmp.* } @@ -46,8 +46,7 @@ nr_cpus=$("$here/src/feature" -o) if [ $nr_cpus -gt 8 ]; then nr_cpus=8 fi -fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 99999 -p $nr_cpus \ - $FSSTRESS_AVOID) +fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 99999 -p $nr_cpus ) _log_writes_init $SCRATCH_DEV # Discard the whole devices so when some tree pointer is wrong, it won't point @@ -135,10 +134,10 @@ pid1=$! delete_workload & pid2=$! -"$FSSTRESS_PROG" $fsstress_args >> $seqres.full & +_run_fsstress_bg $fsstress_args sleep $runtime -"$KILLALL_PROG" -q "$FSSTRESS_PROG" &> /dev/null +_kill_fsstress kill $pid1 &> /dev/null kill $pid2 &> /dev/null wait diff --git a/tests/btrfs/195 b/tests/btrfs/195 index 72fc3a775..4dffddc1a 100755 --- a/tests/btrfs/195 +++ b/tests/btrfs/195 @@ -49,7 +49,7 @@ run_testcase() { _scratch_mount # Create random filesystem with 20k write ops - $FSSTRESS_PROG -d $SCRATCH_MNT -w -n 10000 $FSSTRESS_AVOID >>$seqres.full 2>&1 + _run_fsstress -d $SCRATCH_MNT -w -n 10000 _run_btrfs_balance_start -f -dconvert=$dst_type $SCRATCH_MNT >> $seqres.full [ $? -eq 0 ] || echo "$1: Failed convert" diff --git a/tests/btrfs/212 b/tests/btrfs/212 index f356d7d0f..745b9598a 100755 --- a/tests/btrfs/212 +++ b/tests/btrfs/212 @@ -13,13 +13,13 @@ _begin_fstest auto balance dangerous # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* + _kill_fsstress kill $balance_pid &> /dev/null kill $cancel_pid &> /dev/null - "$KILLALL_PROG" -q $FSSTRESS_PROG &> /dev/null - $BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null wait + $BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null + cd / + rm -f $tmp.* } . ./common/filter @@ -49,7 +49,7 @@ cancel_workload() done } -$FSSTRESS_PROG -d $SCRATCH_MNT -w -n 100000 >> $seqres.full 2>/dev/null & +_run_fsstress_bg -d $SCRATCH_MNT -w -n 100000 balance_workload & balance_pid=$! @@ -58,11 +58,11 @@ cancel_pid=$! sleep $runtime +_kill_fsstress kill $balance_pid kill $cancel_pid -"$KILLALL_PROG" -q $FSSTRESS_PROG &> /dev/null -$BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null wait +$BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null echo "Silence is golden" # success, all done diff --git a/tests/btrfs/232 b/tests/btrfs/232 index 4dcc39cc4..f843edbf7 100755 --- a/tests/btrfs/232 +++ b/tests/btrfs/232 @@ -23,8 +23,8 @@ writer() trap "wait; exit" SIGTERM while true; do - args=`_scale_fsstress_args -p 20 -n 1000 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` - $FSSTRESS_PROG $args >> $seqres.full + args=`_scale_fsstress_args -p 20 -n 1000 -d $SCRATCH_MNT/stressdir` + _run_fsstress $args done } diff --git a/tests/btrfs/252 b/tests/btrfs/252 index 2da02ffa1..bb111b909 100755 --- a/tests/btrfs/252 +++ b/tests/btrfs/252 @@ -24,6 +24,7 @@ _begin_fstest auto send balance stress _cleanup() { + _kill_fsstress if [ ! -z $balance_pid ]; then kill $balance_pid &> /dev/null wait $balance_pid @@ -79,10 +80,10 @@ snapshot_cmd="$snapshot_cmd \"$snapshots_dir/snap_\`date +'%s%N'\`\"" # it's pointless to have them. # echo "Running fsstress..." >> $seqres.full -$FSSTRESS_PROG $FSSTRESS_AVOID -d "$data_subvol" -p 1 -w \ +_run_fsstress -d "$data_subvol" -p 1 -w \ -f subvol_create=0 -f subvol_delete=0 -f snapshot=0 \ -x "$snapshot_cmd" -X $num_snapshots \ - -n $total_fsstress_ops >> $seqres.full + -n $total_fsstress_ops snapshots=(`IFS=$'\n' ls -1 "$snapshots_dir"`) diff --git a/tests/btrfs/261 b/tests/btrfs/261 index 4052baaec..7a08b5667 100755 --- a/tests/btrfs/261 +++ b/tests/btrfs/261 @@ -35,7 +35,7 @@ prepare_fs() # Then use fsstress to generate some extra contents. # Disable setattr related operations, as it may set NODATACOW which will # not allow us to use btrfs checksum to verify the content. - $FSSTRESS_PROG -f setattr=0 -d $SCRATCH_MNT -w -n 3000 >> $seqres.full + _run_fsstress -f setattr=0 -d $SCRATCH_MNT -w -n 3000 sync # Save the fssum of this fs diff --git a/tests/btrfs/284 b/tests/btrfs/284 index 6c554f325..ec3bc2720 100755 --- a/tests/btrfs/284 +++ b/tests/btrfs/284 @@ -49,8 +49,8 @@ run_send_test() # Use a single process so that in case of failure it's easier to # reproduce by using the same seed (logged in $seqres.full). - run_check $FSSTRESS_PROG -d $SCRATCH_MNT -p 1 -n $((LOAD_FACTOR * 200)) \ - -w $FSSTRESS_AVOID -x "$snapshot_cmd" + _run_fsstress -d $SCRATCH_MNT -p 1 -n $((LOAD_FACTOR * 200)) \ + -w -x "$snapshot_cmd" $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \ >> $seqres.full diff --git a/tests/btrfs/286 b/tests/btrfs/286 index b8fa27673..7909fa507 100755 --- a/tests/btrfs/286 +++ b/tests/btrfs/286 @@ -31,7 +31,7 @@ workload() # Use nodatasum mount option, so all data won't have checksum. _scratch_mount -o nodatasum - $FSSTRESS_PROG -p 10 -n 200 -d $SCRATCH_MNT >> $seqres.full + _run_fsstress -p 10 -n 200 -d $SCRATCH_MNT sync # Generate fssum for later verification, here we only care diff --git a/tests/btrfs/320 b/tests/btrfs/320 index 15549165e..bcfb96d1a 100755 --- a/tests/btrfs/320 +++ b/tests/btrfs/320 @@ -28,8 +28,7 @@ _basic_test() $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep $subvolid >> \ $seqres.full 2>&1 [ $? -eq 0 ] || _fail "couldn't find our subvols quota group" - run_check $FSSTRESS_PROG -d $SCRATCH_MNT/a -w -p 1 -n 2000 \ - $FSSTRESS_AVOID + _run_fsstress -d $SCRATCH_MNT/a -w -p 1 -n 2000 _btrfs subvolume snapshot $SCRATCH_MNT/a \ $SCRATCH_MNT/b @@ -55,8 +54,7 @@ _rescan_test() _btrfs subvolume create $SCRATCH_MNT/a _btrfs quota enable $SCRATCH_MNT/a subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) - run_check $FSSTRESS_PROG -d $SCRATCH_MNT/a -w -p 1 -n 2000 \ - $FSSTRESS_AVOID + _run_fsstress -d $SCRATCH_MNT/a -w -p 1 -n 2000 sync output=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") echo "qgroup values before rescan: $output" >> $seqres.full diff --git a/tests/btrfs/332 b/tests/btrfs/332 index ab9860668..4fcdad4cd 100755 --- a/tests/btrfs/332 +++ b/tests/btrfs/332 @@ -32,7 +32,7 @@ d1=$SCRATCH_MNT/d1 d2=$SCRATCH_MNT/d2 mkdir $d1 mkdir $d2 -run_check $FSSTRESS_PROG -d $d1 -w -n 2000 $FSSTRESS_AVOID +_run_fsstress -d $d1 -w -n 2000 fssum_pre=$($FSSUM_PROG -A $SCRATCH_MNT) # enable squotas @@ -45,7 +45,7 @@ fssum_post=$($FSSUM_PROG -A $SCRATCH_MNT) || echo "fssum $fssum_pre does not match $fssum_post after enabling squota" # do some more stuff -run_check $FSSTRESS_PROG -d $d2 -w -n 2000 $FSSTRESS_AVOID +_run_fsstress -d $d2 -w -n 2000 fssum_pre=$($FSSUM_PROG -A $SCRATCH_MNT) _scratch_unmount _check_btrfs_filesystem $SCRATCH_DEV diff --git a/tests/ext4/004 b/tests/ext4/004 index 20cfdb444..ab2f838e9 100755 --- a/tests/ext4/004 +++ b/tests/ext4/004 @@ -12,6 +12,7 @@ _begin_fstest auto dump # Override the default cleanup function. _cleanup() { + _kill_fsstress cd / rm -f $tmp.* # remove the generated data, which is much and meaningless. @@ -29,8 +30,7 @@ workout() echo "Run fsstress" >> $seqres.full args=`_scale_fsstress_args -z -f creat=5 -f write=20 -f mkdir=5 -n 100 -p 15 -d $dump_dir` echo "fsstress $args" >> $seqres.full - - $FSSTRESS_PROG $args >> $seqres.full 2>&1 + _run_fsstress $args echo "start Dump/Restore" >> $seqres.full cd $TEST_DIR diff --git a/tests/ext4/057 b/tests/ext4/057 index 529f0c298..73cdf941a 100755 --- a/tests/ext4/057 +++ b/tests/ext4/057 @@ -8,15 +8,6 @@ . ./common/preamble _begin_fstest auto ioctl -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -r -f $tmp.* - kill -9 $fsstress_pid 2>/dev/null; - wait > /dev/null 2>&1 -} - # Import common functions. . ./common/filter @@ -41,8 +32,7 @@ _scratch_mount # Begin fsstress while modifying UUID fsstress_args=$(_scale_fsstress_args -d $SCRATCH_MNT -p 15 -n 999999) -$FSSTRESS_PROG $fsstress_args >> $seqres.full & -fsstress_pid=$! +_run_fsstress_bg $fsstress_args for n in $(seq 1 20); do new_uuid=$($UUIDGEN_PROG) @@ -57,6 +47,8 @@ for n in $(seq 1 20); do fi done +_kill_fsstress + # success, all done echo "Silence is golden" status=0 diff --git a/tests/ext4/058 b/tests/ext4/058 index a7fc5e6c6..f85364964 100755 --- a/tests/ext4/058 +++ b/tests/ext4/058 @@ -13,7 +13,6 @@ . ./common/preamble _begin_fstest auto quick - _supported_fs ext4 _fixed_by_kernel_commit a08f789d2ab5 \ "ext4: fix bug_on ext4_mb_use_inode_pa" @@ -23,7 +22,7 @@ _require_scratch _scratch_mkfs -g 256 >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount -$FSSTRESS_PROG -d $SCRATCH_MNT/stress -n 1000 >> $seqres.full 2>&1 +_run_fsstress -d $SCRATCH_MNT/stress -n 1000 echo "Silence is golden" diff --git a/tests/ext4/307 b/tests/ext4/307 index f7c95c51b..8361f0431 100755 --- a/tests/ext4/307 +++ b/tests/ext4/307 @@ -19,9 +19,9 @@ _workout() echo "" echo "Run fsstress" out=$SCRATCH_MNT/fsstress.$$ - args=`_scale_fsstress_args -p4 -n999 -f setattr=1 $FSSTRESS_AVOID -d $out` + args=`_scale_fsstress_args -p4 -n999 -f setattr=1 -d $out` echo "fsstress $args" >> $seqres.full - $FSSTRESS_PROG $args >> $seqres.full + _run_fsstress $args find $out -type f > $out.list cat $out.list | xargs md5sum > $out.md5sum usage=`du -sch $out | tail -n1 | gawk '{ print $1 }'` diff --git a/tests/generic/013 b/tests/generic/013 index 3a000b97f..0b86d8b33 100755 --- a/tests/generic/013 +++ b/tests/generic/013 @@ -9,18 +9,6 @@ . ./common/preamble _begin_fstest other ioctl udf auto quick -status=0 # success is the default! - -# Override the default cleanup function. -_cleanup() -{ - cd / - # we might get here with a RO FS - _test_cycle_mount - # now remove fsstress directory. - rm -rf $TEST_DIR/fsstress.$$.* -} - # Import common functions. . ./common/filter @@ -30,7 +18,7 @@ _do_test() _param="$2" _count="$3" - out=$TEST_DIR/fsstress.$$.$_n + out=$TEST_DIR/fsstress.$seq.$_n rm -rf $out if ! mkdir $out then @@ -44,9 +32,8 @@ _do_test() echo "fsstress.$_n : $_param" echo "-----------------------------------------------" # -m limits number of users/groups so check doesn't fail (malloc) later - dbgoutfile=$seqres.full - if ! $FSSTRESS_PROG $_param $FSSTRESS_AVOID -v -m 8 -n $_count -d $out >>$dbgoutfile 2>&1 - then + _run_fsstress $_param -v -m 8 -n $_count -d $out + if [ $? -ne 0 ]; then echo " fsstress (count=$_count) returned $? - see $seqres.full" echo "--------------------------------------" >>$seqres.full echo "$_n - output from fsstress:" >>$seqres.full @@ -62,6 +49,7 @@ _do_test() _require_test echo "brevity is wit..." +status=0 count=1000 procs=20 @@ -80,7 +68,7 @@ _do_test 2 "-p $procs -r" $count _do_test 3 "-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20" $count -# if all ok by here then probably don't need $seqres.full +rm -rf $TEST_DIR/fsstress.$seq.* exit diff --git a/tests/generic/019 b/tests/generic/019 index fe117ac8a..bed916b53 100755 --- a/tests/generic/019 +++ b/tests/generic/019 @@ -22,7 +22,9 @@ _require_fail_make_request # Override the default cleanup function. _cleanup() { - kill $fs_pid $fio_pid &> /dev/null + _kill_fsstress + kill $fio_pid &> /dev/null + wait _disallow_fail_make_request cd / rm -r -f $tmp.* @@ -85,13 +87,12 @@ FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0 -f setattr=1" _workout() { out=$SCRATCH_MNT/fsstress.$$ - args=`_scale_fsstress_args -p 1 -n999999999 -f setattr=0 $FSSTRESS_AVOID -d $out` + args=`_scale_fsstress_args -p 1 -n999999999 -f setattr=0 -d $out` echo "" echo "Start fsstress.." echo "" echo "fsstress $args" >> $seqres.full - $FSSTRESS_PROG $args >> $seqres.full 2>&1 & - fs_pid=$! + _run_fsstress_bg $args echo "Start fio.." cat $fio_config >> $seqres.full $FIO_PROG $fio_config >> $seqres.full 2>&1 & @@ -107,10 +108,8 @@ _workout() >> $seqres.full 2>&1 && \ _fail "failed: still able to perform integrity fsync on $SCRATCH_MNT" - kill $fs_pid &> /dev/null - wait $fs_pid + _kill_fsstress wait $fio_pid - unset fs_pid unset fio_pid # We expect that broken FS still can be umounted diff --git a/tests/generic/051 b/tests/generic/051 index 65571fdd0..69250cde6 100755 --- a/tests/generic/051 +++ b/tests/generic/051 @@ -14,18 +14,8 @@ _begin_fstest shutdown auto stress log metadata repair # Import common functions. . ./common/filter -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - - _require_scratch _require_scratch_shutdown -_require_command "$KILLALL_PROG" killall _scratch_mkfs > $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV @@ -37,25 +27,23 @@ PROCS=$((2 * LOAD_FACTOR)) load_dir=$SCRATCH_MNT/test # let this run for a while -$FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 & +_run_fsstress_bg -n 10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME -$KILLALL_PROG -q $FSSTRESS_PROG -wait +_kill_fsstress sync _scratch_unmount # now mount again, run the load again, this time with a shutdown. _scratch_mount $XFS_FSR_PROG -v $load_dir >> $seqres.full 2>&1 -$FSSTRESS_PROG -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 & +_run_fsstress_bg -n10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME sync # now shutdown and unmount sleep 5 _scratch_shutdown -$KILLALL_PROG -q $FSSTRESS_PROG -wait +_kill_fsstress # for some reason fsstress processes manage to live on beyond the wait? sleep 5 diff --git a/tests/generic/055 b/tests/generic/055 index b1126c901..e57f95faf 100755 --- a/tests/generic/055 +++ b/tests/generic/055 @@ -23,9 +23,9 @@ _do_meta() param="-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 \ -f rename=30 -f stat=30 -f unlink=30 -f truncate=20" _echofull "calling fsstress $param -m8 -n $count" - FSSTRESS_ARGS=`_scale_fsstress_args $param $FSSTRESS_AVOID -m 8 -n $count -d $out` - if ! $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full 2>&1 - then + FSSTRESS_ARGS=`_scale_fsstress_args $param -m 8 -n $count -d $out` + _run_fsstress $FSSTRESS_ARGS + if [ $? -ne 0 ]; then _echofull "fsstress failed" fi } diff --git a/tests/generic/068 b/tests/generic/068 index 1e8248b9d..26c5ceea6 100755 --- a/tests/generic/068 +++ b/tests/generic/068 @@ -19,8 +19,7 @@ _cleanup() { # Make sure $SCRATCH_MNT is unfreezed xfs_freeze -u $SCRATCH_MNT 2>/dev/null - [ -n "$pid" ] && kill -9 $pid 2>/dev/null - wait $pid + _kill_fsstress cd / rm -f $tmp.* } @@ -54,8 +53,8 @@ touch $tmp.running do # We do both read & write IO - not only is this more realistic, # but it also potentially tests atime updates - FSSTRESS_ARGS=`_scale_fsstress_args -d $STRESS_DIR -p $procs -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full + FSSTRESS_ARGS=`_scale_fsstress_args -d $STRESS_DIR -p $procs -n $nops` + _run_fsstress $FSSTRESS_ARGS >>$seqres.full done rm -r $STRESS_DIR/* diff --git a/tests/generic/070 b/tests/generic/070 index a8e84effd..000fc0482 100755 --- a/tests/generic/070 +++ b/tests/generic/070 @@ -9,19 +9,10 @@ . ./common/preamble _begin_fstest attr udf auto quick stress -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -rf $TEST_DIR/fsstress - rm -f $tmp.* -} - # Import common functions. . ./common/filter . ./common/attr - _require_test _require_attrs @@ -34,7 +25,8 @@ FSSTRESS_ARGS=`_scale_fsstress_args \ -f attr_set=100 \ -f attr_remove=100 \ -p 1 -n 10000 -S c` -$FSSTRESS_PROG $FSSTRESS_ARGS >$seqres.full 2>&1 +_run_fsstress $FSSTRESS_ARGS +rm -rf $TEST_DIR/fsstress status=$? exit diff --git a/tests/generic/076 b/tests/generic/076 index b50c2df5e..100f19715 100755 --- a/tests/generic/076 +++ b/tests/generic/076 @@ -21,16 +21,14 @@ _lets_get_pidst() # Override the default cleanup function. _cleanup() { - echo "*** unmount" - _scratch_unmount 2>/dev/null _lets_get_pidst + cd / + rm -f $tmp.* } -_register_cleanup "_cleanup; rm -f $tmp.*" # Import common functions. . ./common/filter - _require_scratch _require_local_device $SCRATCH_DEV @@ -48,9 +46,9 @@ echo "*** test concurrent block/fs access" cat $SCRATCH_DEV >/dev/null & pid=$! -FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p 2 -n 2000 $FSSTRESS_AVOID` +FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p 2 -n 2000` echo "run fsstress with args: $FSSTRESS_ARGS" >>$seqres.full -$FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full +_run_fsstress $FSSTRESS_ARGS _lets_get_pidst echo "*** done" diff --git a/tests/generic/076.out b/tests/generic/076.out index 54a8f7096..74a65bdec 100644 --- a/tests/generic/076.out +++ b/tests/generic/076.out @@ -2,4 +2,3 @@ QA output created by 076 *** init fs *** test concurrent block/fs access *** done -*** unmount diff --git a/tests/generic/083 b/tests/generic/083 index ff4785eee..6aa0ea06d 100755 --- a/tests/generic/083 +++ b/tests/generic/083 @@ -18,18 +18,9 @@ . ./common/preamble _begin_fstest rw auto enospc stress -# Override the default cleanup function. -_cleanup() -{ - echo "*** unmount" - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - # Import common functions. . ./common/filter - _require_scratch _require_no_large_scratch_dev @@ -52,8 +43,8 @@ workout() _scratch_mount # -w ensures that the only ops are ones which cause write I/O - FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full + FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops` + _run_fsstress $FSSTRESS_ARGS >>$seqres.full } echo "*** test out-of-space handling for random write operations" diff --git a/tests/generic/083.out b/tests/generic/083.out index 025afe30e..b853eadb4 100644 --- a/tests/generic/083.out +++ b/tests/generic/083.out @@ -1,4 +1,3 @@ QA output created by 083 *** test out-of-space handling for random write operations *** done -*** unmount diff --git a/tests/generic/117 b/tests/generic/117 index f9769be94..a34f86165 100755 --- a/tests/generic/117 +++ b/tests/generic/117 @@ -63,9 +63,7 @@ echo Running fsstress in serial: i=0 while [ $i -lt $ITERATIONS ]; do echo fsstress iteration: $i | tee -a $seqres.full - $FSSTRESS_PROG \ - -d $SCRATCH_MNT/fsstress \ - $fss_ops -S c >>$seqres.full 2>&1 + _run_fsstress -d $SCRATCH_MNT/fsstress $fss_ops -S c let i=$i+1 done diff --git a/tests/generic/232 b/tests/generic/232 index 35934cc18..c903a5619 100755 --- a/tests/generic/232 +++ b/tests/generic/232 @@ -30,13 +30,12 @@ _fsstress() out=$SCRATCH_MNT/fsstress.$$ count=2000 - args=`_scale_fsstress_args -d $out -n $count -p 7 $FSSTRESS_AVOID` + args=`_scale_fsstress_args -d $out -n $count -p 7` echo "fsstress $args" >> $seqres.full - if ! $FSSTRESS_PROG $args | tee -a $seqres.full | _filter_num + if ! _run_fsstress $args then echo " fsstress $args returned $?" - cat $tmp.out | tee -a $seqres.full status=1 fi } diff --git a/tests/generic/232.out b/tests/generic/232.out index 5da53d4bf..9214607f0 100644 --- a/tests/generic/232.out +++ b/tests/generic/232.out @@ -2,6 +2,5 @@ QA output created by 232 Testing fsstress -seed = S Comparing user usage Comparing group usage diff --git a/tests/generic/269 b/tests/generic/269 index 341fcd22f..979cc15cb 100755 --- a/tests/generic/269 +++ b/tests/generic/269 @@ -21,10 +21,9 @@ _workout() num_iterations=10 enospc_time=2 out=$SCRATCH_MNT/fsstress.$$ - args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out` + args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 -d $out` echo "fsstress $args" >> $seqres.full - $FSSTRESS_PROG $args &>> $seqres.full & - pid=$! + _run_fsstress_bg $args echo "Run dd writers in parallel" for ((i=0; i < num_iterations; i++)) do @@ -34,8 +33,7 @@ _workout() sleep $enospc_time done echo "Killing fsstress process..." >> $seqres.full - kill $pid >> $seqres.full 2>&1 - wait $pid + _kill_fsstress } _require_scratch diff --git a/tests/generic/270 b/tests/generic/270 index cf523f4ea..aff379ac5 100755 --- a/tests/generic/270 +++ b/tests/generic/270 @@ -28,8 +28,8 @@ _workout() args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out` echo "fsstress $args" >> $seqres.full # Grant chown capability - cp $FSSTRESS_PROG $tmp.fsstress.bin - $SETCAP_PROG cap_chown=epi $tmp.fsstress.bin + cp $FSSTRESS_PROG $_FSSTRESS_PROG + $SETCAP_PROG cap_chown=epi $_FSSTRESS_PROG # io_uring accounts memory it needs under the rlimit memlocked option, # which can be quite low on some setups (especially 64K pagesize). root @@ -37,7 +37,8 @@ _workout() # io_uring_queue_init fail on ENOMEM, set max locked memory to unlimited # temporarily. ulimit -l unlimited - (su $qa_user -c "$tmp.fsstress.bin $args" &) > /dev/null 2>&1 + su $qa_user -c "$_FSSTRESS_PROG $args" > /dev/null 2>&1 & + _FSSTRESS_PID=$! echo "Run dd writers in parallel" for ((i=0; i < num_iterations; i++)) @@ -49,7 +50,7 @@ _workout() sleep $enospc_time done - $KILLALL_PROG -w $tmp.fsstress.bin + _kill_fsstress } _require_quota diff --git a/tests/generic/388 b/tests/generic/388 index 89ddda31d..34609a0d3 100755 --- a/tests/generic/388 +++ b/tests/generic/388 @@ -17,23 +17,9 @@ . ./common/preamble _begin_fstest shutdown auto log metadata recoveryloop -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - _scratch_unmount > /dev/null 2>&1 -} - -# Import common functions. - -# Modify as appropriate. - _require_scratch _require_local_device $SCRATCH_DEV _require_scratch_shutdown -_require_command "$KILLALL_PROG" "killall" echo "Silence is golden." @@ -42,20 +28,14 @@ _require_metadata_journaling $SCRATCH_DEV _scratch_mount while _soak_loop_running $((50 * TIME_FACTOR)); do - ($FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p 4 >> $seqres.full &) \ - > /dev/null 2>&1 + _run_fsstress_bg -d $SCRATCH_MNT -n 999999 -p 4 # purposely include 0 second sleeps to test shutdown immediately after # recovery sleep $((RANDOM % 3)) _scratch_shutdown - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress # Toggle between rw and ro mounts for recovery. Quit if any mount # attempt fails so we don't shutdown the host fs. diff --git a/tests/generic/390 b/tests/generic/390 index 02f6c5eef..52270782e 100755 --- a/tests/generic/390 +++ b/tests/generic/390 @@ -18,8 +18,7 @@ _cleanup() [ -n "$freeze_pids" ] && kill -9 $freeze_pids 2>/dev/null wait $freeze_pids xfs_freeze -u $SCRATCH_MNT 2>/dev/null - [ -n "$fsstress_pid" ] && kill -9 $fsstress_pid 2>/dev/null - wait $fsstress_pid + _kill_fsstress rm -f $tmp.* } @@ -49,9 +48,8 @@ fi nops=1000 stress_dir="$SCRATCH_MNT/fsstress_test_dir" mkdir "$stress_dir" -fsstress_args=`_scale_fsstress_args -d $stress_dir -p $procs -n $nops $FSSTRESS_AVOID` -$FSSTRESS_PROG $fsstress_args >>$seqres.full 2>&1 & -fsstress_pid=$! +fsstress_args=`_scale_fsstress_args -d $stress_dir -p $procs -n $nops` +_run_fsstress_bg $fsstress_args # Start multi-threads freeze/unfreeze for ((i=0; i<$procs; i++)); do @@ -62,9 +60,8 @@ for ((i=0; i<$procs; i++)); do freeze_pids="$! $freeze_pids" done -wait $fsstress_pid +_wait_for_fsstress result=$? -unset fsstress_pid wait $freeze_pids unset freeze_pids diff --git a/tests/generic/409 b/tests/generic/409 index b7edc2ac6..ab7e7eb55 100755 --- a/tests/generic/409 +++ b/tests/generic/409 @@ -25,11 +25,12 @@ _begin_fstest auto quick mount # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* + _kill_fsstress _clear_mount_stack # make sure there's no bug cause dentry isn't be freed rm -rf $MNTHEAD + cd / + rm -f $tmp.* } # Import common functions. @@ -43,7 +44,7 @@ fs_stress() { local target=$1 - $FSSTRESS_PROG -z -n 50 -p 3 \ + _run_fsstress -z -n 50 -p 3 \ -f creat=5 \ -f mkdir=5 \ -f link=2 \ @@ -56,7 +57,7 @@ fs_stress() -f chown=1 \ -f getdents=1 \ -f fiemap=1 \ - -d $target >>$seqres.full + -d $target sync } diff --git a/tests/generic/410 b/tests/generic/410 index 902f27144..f0f0921be 100755 --- a/tests/generic/410 +++ b/tests/generic/410 @@ -33,11 +33,12 @@ _begin_fstest auto quick mount # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* + _kill_fsstress _clear_mount_stack # make sure there's no bug cause dentry isn't be freed rm -rf $MNTHEAD + cd / + rm -f $tmp.* } # Import common functions. @@ -51,7 +52,7 @@ fs_stress() { local target=$1 - $FSSTRESS_PROG -z -n 50 -p 3 \ + _run_fsstress -z -n 50 -p 3 \ -f creat=5 \ -f mkdir=5 \ -f link=2 \ @@ -64,7 +65,7 @@ fs_stress() -f chown=1 \ -f getdents=1 \ -f fiemap=1 \ - -d $target >>$seqres.full + -d $target sync } diff --git a/tests/generic/411 b/tests/generic/411 index c35436c82..3b55b4f91 100755 --- a/tests/generic/411 +++ b/tests/generic/411 @@ -14,11 +14,12 @@ _begin_fstest auto quick mount # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* + _kill_fsstress _clear_mount_stack # make sure there's no bug cause dentry isn't be freed rm -rf $MNTHEAD + cd / + rm -f $tmp.* } # Import common functions. @@ -32,7 +33,7 @@ fs_stress() { local target=$1 - $FSSTRESS_PROG -z -n 500 -p 5 \ + _run_fsstress -z -n 500 -p 5 \ -f creat=5 \ -f mkdir=5 \ -f dwrite=1 \ @@ -47,7 +48,7 @@ fs_stress() -f chown=1 \ -f getdents=1 \ -f fiemap=1 \ - -d $target >>$seqres.full + -d $target sync } diff --git a/tests/generic/461 b/tests/generic/461 index 468ce46f0..95dd6a34d 100755 --- a/tests/generic/461 +++ b/tests/generic/461 @@ -14,18 +14,8 @@ _begin_fstest auto shutdown stress # Import common functions. . ./common/filter -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - - _require_scratch_nocheck _require_scratch_shutdown -_require_command "$KILLALL_PROG" killall _scratch_mkfs > $seqres.full 2>&1 _scratch_mount @@ -35,15 +25,14 @@ PROCS=$((4 * LOAD_FACTOR)) load_dir=$SCRATCH_MNT/test -$FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 & +_run_fsstress_bg -n10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME sync # now shutdown and unmount sleep 5 _scratch_shutdown -$KILLALL_PROG -q $FSSTRESS_PROG -wait +_kill_fsstress # for some reason fsstress processes manage to live on beyond the wait? sleep 5 diff --git a/tests/generic/475 b/tests/generic/475 index 4b854f9ab..9df2051fb 100755 --- a/tests/generic/475 +++ b/tests/generic/475 @@ -17,11 +17,11 @@ _begin_fstest shutdown auto log metadata eio recoveryloop smoketest # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 + _kill_fsstress _dmerror_unmount _dmerror_cleanup + cd / + rm -f $tmp.* } # Import common functions. @@ -31,7 +31,6 @@ _cleanup() _require_scratch _require_dm_target error -_require_command "$KILLALL_PROG" "killall" echo "Silence is golden." @@ -41,8 +40,7 @@ _dmerror_init _dmerror_mount while _soak_loop_running $((50 * TIME_FACTOR)); do - ($FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4)) >> $seqres.full &) \ - > /dev/null 2>&1 + _run_fsstress_bg -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4)) # purposely include 0 second sleeps to test shutdown immediately after # recovery @@ -55,12 +53,7 @@ while _soak_loop_running $((50 * TIME_FACTOR)); do # error table helper *without* 'lockfs'. _dmerror_load_error_table - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress # Mount again to replay log after loading working table, so we have a # consistent XFS after test. diff --git a/tests/generic/476 b/tests/generic/476 index cf7402a12..769b3745f 100755 --- a/tests/generic/476 +++ b/tests/generic/476 @@ -10,20 +10,7 @@ . ./common/preamble _begin_fstest auto rw long_rw stress soak smoketest -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 -} - -# Import common functions. - -# Modify as appropriate. - _require_scratch -_require_command "$KILLALL_PROG" "killall" echo "Silence is golden." @@ -35,7 +22,7 @@ nr_ops=$((25000 * nr_cpus * TIME_FACTOR)) fsstress_args=(-w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus) test -n "$SOAK_DURATION" && fsstress_args+=(--duration="$SOAK_DURATION") -$FSSTRESS_PROG $FSSTRESS_AVOID "${fsstress_args[@]}" >> $seqres.full +_run_fsstress_bg "${fsstress_args[@]}" # success, all done status=0 diff --git a/tests/generic/482 b/tests/generic/482 index 54fee07d4..8c114ee03 100755 --- a/tests/generic/482 +++ b/tests/generic/482 @@ -18,10 +18,10 @@ _begin_fstest auto metadata replay thin recoveryloop # failure leaves the corpse intact for post-mortem failure analysis. _cleanup() { - cd / - $KILLALL_PROG -KILL -q $FSSTRESS_PROG &> /dev/null + _kill_fsstress _log_writes_cleanup &> /dev/null _dmthin_cleanup + cd / rm -f $tmp.* } @@ -29,7 +29,7 @@ _cleanup() #_cleanup() #{ # cd / -# $KILLALL_PROG -KILL -q $FSSTRESS_PROG &> /dev/null +# [ -n "$fsstress_pid" ] && kill $fsstress_pid # if [ $status -eq 0 ]; then # _log_writes_cleanup &> /dev/null # _dmthin_cleanup @@ -48,7 +48,6 @@ _cleanup() # Modify as appropriate. _require_no_logdev -_require_command "$KILLALL_PROG" killall # Use thin device as replay device, which requires $SCRATCH_DEV _require_scratch_nocheck # and we need extra device as log device @@ -60,8 +59,7 @@ nr_cpus=$("$here/src/feature" -o) if [ $nr_cpus -gt 8 ]; then nr_cpus=8 fi -fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 512 -p $nr_cpus \ - $FSSTRESS_AVOID) +fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 512 -p $nr_cpus) size=$(_small_fs_size_mb 200) # 200m phys/virt size devsize=$((1024*1024*size / 512)) @@ -77,7 +75,7 @@ _log_writes_mkfs >> $seqres.full 2>&1 _log_writes_mark mkfs _log_writes_mount -run_check $FSSTRESS_PROG $fsstress_args +_run_fsstress $fsstress_args _log_writes_unmount _log_writes_remove diff --git a/tests/generic/547 b/tests/generic/547 index 1e3881db9..14d02b4fd 100755 --- a/tests/generic/547 +++ b/tests/generic/547 @@ -14,6 +14,7 @@ _begin_fstest auto quick log # Override the default cleanup function. _cleanup() { + _kill_fsstress _cleanup_flakey cd / rm -f $tmp.* @@ -38,10 +39,10 @@ _init_flakey _mount_flakey mkdir $SCRATCH_MNT/test -args=`_scale_fsstress_args -p 4 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/test` +args=`_scale_fsstress_args -p 4 -n 100 -d $SCRATCH_MNT/test` args="$args -f mknod=0 -f symlink=0" echo "Running fsstress with arguments: $args" >>$seqres.full -$FSSTRESS_PROG $args >>$seqres.full +_run_fsstress $args # Fsync every file and directory. find $SCRATCH_MNT/test \( -type f -o -type d \) -exec $XFS_IO_PROG -c fsync {} \; diff --git a/tests/generic/560 b/tests/generic/560 index 62983d69b..067d3ec00 100755 --- a/tests/generic/560 +++ b/tests/generic/560 @@ -30,8 +30,8 @@ function iterate_dedup_verify() find $dest -type f -exec md5sum {} \; \ > $md5file$index # Make some noise - $FSSTRESS_PROG $fsstress_opts -d $noisedir \ - -n 200 -p $((5 * LOAD_FACTOR)) >/dev/null 2>&1 + _run_fsstress $fsstress_opts -d $noisedir \ + -n 200 -p $((5 * LOAD_FACTOR)) # Too many output, so only save error output $DUPEREMOVE_PROG -dr --dedupe-options=same $dupdir \ >/dev/null 2>$seqres.full @@ -51,8 +51,7 @@ md5file=${tmp}.md5sum fsstress_opts="-w -r" # Create some files to be original data -$FSSTRESS_PROG $fsstress_opts -d $srcdir \ - -n 500 -p $((5 * LOAD_FACTOR)) >/dev/null 2>&1 +_run_fsstress $fsstress_opts -d $srcdir -n 500 -p $((5 * LOAD_FACTOR)) # Calculate how many test cycles will be run src_size=`du -ks $srcdir | awk '{print $1}'` diff --git a/tests/generic/561 b/tests/generic/561 index 39e5977a3..3e931b1a7 100755 --- a/tests/generic/561 +++ b/tests/generic/561 @@ -13,9 +13,9 @@ _begin_fstest auto stress dedupe # Override the default cleanup function. _cleanup() { + end_test cd / rm -f $tmp.* - end_test } # Import common functions. @@ -23,28 +23,20 @@ _cleanup() . ./common/reflink _require_scratch_duperemove -_require_command "$KILLALL_PROG" killall _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 function end_test() { - local f=1 + _kill_fsstress # stop duperemove running if [ -e $dupe_run ]; then rm -f $dupe_run - $KILLALL_PROG -q $DUPEREMOVE_PROG > /dev/null 2>&1 + kill $dedup_pids wait $dedup_pids fi - - # Make sure all fsstress get killed - while [ $f -ne 0 ]; do - $KILLALL_PROG -q $FSSTRESS_PROG > /dev/null 2>&1 - sleep 1 - f=`ps -eLf | grep $FSSTRESS_PROG | grep -v "grep" | wc -l` - done } sleep_time=$((50 * TIME_FACTOR)) @@ -53,7 +45,8 @@ sleep_time=$((50 * TIME_FACTOR)) testdir="$SCRATCH_MNT/dir" mkdir $testdir fsstress_opts="-r -n 1000 -p $((5 * LOAD_FACTOR))" -$FSSTRESS_PROG $fsstress_opts -d $testdir -l 0 >> $seqres.full 2>&1 & +_run_fsstress_bg $fsstress_opts -d $testdir -l 0 + dedup_pids="" dupe_run=$TEST_DIR/${seq}-running # Start several dedupe processes on same directory diff --git a/tests/generic/579 b/tests/generic/579 index 3191342b3..4187ab0f0 100755 --- a/tests/generic/579 +++ b/tests/generic/579 @@ -16,7 +16,7 @@ _begin_fstest auto stress verity _cleanup() { # Stop all subprocesses. - $KILLALL_PROG -q $FSSTRESS_PROG + _kill_fsstress touch $tmp.done wait @@ -29,7 +29,6 @@ _cleanup() . ./common/verity _require_scratch_verity -_require_command "$KILLALL_PROG" killall _disable_fsverity_signatures _scratch_mkfs_verity &>> $seqres.full @@ -92,8 +91,7 @@ done ) & # Start the fsstress processes. -$FSSTRESS_PROG $FSSTRESS_AVOID -p $nproc_stress -l 0 -d $SCRATCH_MNT/stressdir \ - >> $seqres.full 2>&1 & +_run_fsstress_bg -p $nproc_stress -l 0 -d $SCRATCH_MNT/stressdir # Run for a while. sleep $runtime diff --git a/tests/generic/585 b/tests/generic/585 index fb675c8d5..b95cd9abf 100755 --- a/tests/generic/585 +++ b/tests/generic/585 @@ -23,10 +23,10 @@ _scratch_mount >> $seqres.full 2>&1 # start a create and rename(rename_whiteout) workload. These processes # occur simultaneously may cause the deadlock between AGI and AGF with # RENAME_WHITEOUT. -$FSSTRESS_PROG -z -n 150 -p 100 \ +_run_fsstress -z -n 150 -p 100 \ -f mknod=5 \ -f rwhiteout=5 \ - -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1 + -d $SCRATCH_MNT/fsstress echo Silence is golden diff --git a/tests/generic/589 b/tests/generic/589 index 0ce16556a..969a8ac61 100755 --- a/tests/generic/589 +++ b/tests/generic/589 @@ -28,11 +28,12 @@ _begin_fstest auto mount # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* + _kill_fsstress _clear_mount_stack # make sure there's no bug cause dentry isn't be freed rm -rf $MNTHEAD + cd / + rm -f $tmp.* } # Import common functions. @@ -46,7 +47,7 @@ fs_stress() { local target=$1 - $FSSTRESS_PROG -n 50 -p 3 -d $target >>$seqres.full + _run_fsstress -n 50 -p 3 -d $target sync } diff --git a/tests/generic/642 b/tests/generic/642 index a7112a08f..4b92a9c18 100755 --- a/tests/generic/642 +++ b/tests/generic/642 @@ -10,17 +10,9 @@ . ./common/preamble _begin_fstest auto soak attr long_rw stress smoketest -_cleanup() -{ - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - cd / - rm -f $tmp.* -} - # Modify as appropriate. _require_scratch -_require_command "$KILLALL_PROG" "killall" echo "Silence is golden." @@ -50,7 +42,7 @@ args+=('-f' "setfattr=20") args+=('-f' "attr_set=60") # sets larger xattrs test -n "$SOAK_DURATION" && args+=(--duration="$SOAK_DURATION") -$FSSTRESS_PROG "${args[@]}" $FSSTRESS_AVOID -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus >> $seqres.full +_run_fsstress "${args[@]}" -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus # success, all done status=0 diff --git a/tests/generic/648 b/tests/generic/648 index 29d1b470b..e4c9990e1 100755 --- a/tests/generic/648 +++ b/tests/generic/648 @@ -16,16 +16,15 @@ _begin_fstest shutdown auto log metadata eio recoveryloop _cleanup() { - cd / - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait + _kill_fsstress if [ -n "$loopmnt" ]; then $UMOUNT_PROG $loopmnt 2>/dev/null rm -r -f $loopmnt fi - rm -f $tmp.* _dmerror_unmount _dmerror_cleanup + cd / + rm -f $tmp.* } # Import common functions. @@ -37,7 +36,6 @@ _cleanup() _require_scratch_reflink _require_cp_reflink _require_dm_target error -_require_command "$KILLALL_PROG" "killall" _require_loop echo "Silence is golden." @@ -71,8 +69,6 @@ snap_loop_fs() { rm -f "$snap_aliveflag" } -fsstress=($FSSTRESS_PROG $FSSTRESS_AVOID -d "$loopmnt" -n 999999 -p "$((LOAD_FACTOR * 4))") - while _soak_loop_running $((25 * TIME_FACTOR)); do touch $scratch_aliveflag snap_loop_fs >> $seqres.full 2>&1 & @@ -84,7 +80,7 @@ while _soak_loop_running $((25 * TIME_FACTOR)); do break fi - ("${fsstress[@]}" >> $seqres.full &) > /dev/null 2>&1 + _run_fsstress_bg -d "$loopmnt" -n 999999 -p "$((LOAD_FACTOR * 4))" # purposely include 0 second sleeps to test shutdown immediately after # recovery @@ -98,12 +94,7 @@ while _soak_loop_running $((25 * TIME_FACTOR)); do # error table helper *without* 'lockfs'. _dmerror_load_error_table - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress for ((j = 0; j < 10; j++)); do test -e "$snap_aliveflag" || break sleep 1 diff --git a/tests/generic/650 b/tests/generic/650 index 5d2cb8977..36a23e48d 100755 --- a/tests/generic/650 +++ b/tests/generic/650 @@ -16,14 +16,14 @@ _begin_fstest auto rw stress soak # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 + _kill_fsstress wait # for exercise_cpu_hotplug subprocess for i in "$sysfs_cpu_dir/"cpu*/online; do echo 1 > "$i" 2>/dev/null done test -n "$stress_dir" && rm -r -f "$stress_dir" + cd / + rm -f $tmp.* } exercise_cpu_hotplug() @@ -39,7 +39,6 @@ exercise_cpu_hotplug() } _require_test -_require_command "$KILLALL_PROG" "killall" sysfs_cpu_dir="/sys/devices/system/cpu" @@ -71,13 +70,17 @@ test "$nr_cpus" -gt 1024 && nr_cpus="$nr_hotplug_cpus" fsstress_args+=(-p $nr_cpus) if [ -n "$SOAK_DURATION" ]; then test "$SOAK_DURATION" -lt 10 && SOAK_DURATION=10 - fsstress_args+=(--duration="$((SOAK_DURATION / 10))") +else + # run for 30s per iteration max + SOAK_DURATION=300 fi +fsstress_args+=(--duration="$((SOAK_DURATION / 10))") nr_ops=$((2500 * TIME_FACTOR)) fsstress_args+=(-n $nr_ops) for ((i = 0; i < 10; i++)); do - $FSSTRESS_PROG $FSSTRESS_AVOID -w "${fsstress_args[@]}" >> $seqres.full + _run_fsstress_bg -w "${fsstress_args[@]}" + _wait_for_fsstress _test_cycle_mount done diff --git a/tests/generic/750 b/tests/generic/750 index dba8021d6..5c54a5c78 100755 --- a/tests/generic/750 +++ b/tests/generic/750 @@ -11,13 +11,12 @@ _begin_fstest auto rw long_rw stress soak smoketest _cleanup() { - cd / + _kill_fsstress rm -f $runfile - rm -f $tmp.* kill -9 $trigger_compaction_pid > /dev/null 2>&1 - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 + rm -f $tmp.* + cd / } # Import common functions. @@ -26,7 +25,6 @@ _cleanup() _require_scratch _require_vm_compaction -_require_command "$KILLALL_PROG" "killall" # We still deadlock with this test on v6.10-rc2, we need more work. # but the below makes things better. @@ -52,7 +50,7 @@ while [ -e $runfile ]; do done & trigger_compaction_pid=$! -$FSSTRESS_PROG $FSSTRESS_AVOID "${fsstress_args[@]}" >> $seqres.full +_run_fsstress "${fsstress_args[@]}" rm -f $runfile wait > /dev/null 2>&1 diff --git a/tests/generic/753 b/tests/generic/753 index e427d62d1..f5665320a 100755 --- a/tests/generic/753 +++ b/tests/generic/753 @@ -16,11 +16,11 @@ _begin_fstest shutdown auto log metadata eio recoveryloop attr # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 + _kill_fsstress _dmerror_unmount _dmerror_cleanup + cd / + rm -f $tmp.* } # Import common functions. @@ -30,7 +30,6 @@ _cleanup() _require_scratch _require_dm_target error -_require_command "$KILLALL_PROG" "killall" echo "Silence is golden." @@ -59,8 +58,7 @@ args+=('-f' "setfattr=20") args+=('-f' "attr_set=60") # sets larger xattrs while _soak_loop_running $((50 * TIME_FACTOR)); do - ($FSSTRESS_PROG "${args[@]}" $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4)) >> $seqres.full &) \ - > /dev/null 2>&1 + _run_fsstress_bg "${args[@]}" -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4)) # purposely include 0 second sleeps to test shutdown immediately after # recovery @@ -73,12 +71,7 @@ while _soak_loop_running $((50 * TIME_FACTOR)); do # error table helper *without* 'lockfs'. _dmerror_load_error_table - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress # Mount again to replay log after loading working table, so we have a # consistent XFS after test. diff --git a/tests/overlay/019 b/tests/overlay/019 index ae026604d..b20b7ae52 100755 --- a/tests/overlay/019 +++ b/tests/overlay/019 @@ -9,6 +9,22 @@ . ./common/preamble _begin_fstest auto stress +# This nests multiple background fsstress instances, so we have to +# do some magic with _FSSTRESS_PID here. +_cleanup() +{ + if [ -n "$fsstress_pid_1" ]; then + FSTRESS_PID=$fsstress_pid_1 + _kill_fsstress + fi + if [ -n "$fsstress_pid_2" ]; then + FSTRESS_PID=$fsstress_pid_2 + _kill_fsstress + fi + cd / + rm -f tmp.* +} + # Import common functions. . ./common/filter @@ -28,29 +44,31 @@ d_low=$lowerdir/fsstress d_top=$SCRATCH_MNT/fsstress mkdir -p $d_low $d_top -echo $FSSTRESS_PROG -s 42 -d $d_low -p 4 -n 1000 -l100 -v > $seqres.full.1 -$FSSTRESS_PROG -s 42 -d $d_low -p 4 -n 1000 -l100 -v >> $seqres.full.1 2>&1 & +echo fsstress -s 42 -d $d_low -p 4 -n 1000 -l100 -v >> $seqres.full +_run_fsstress_bg -s 42 -d $d_low -p 4 -n 1000 -l100 -v +fsstress_pid_1=$_FSSTRESS_PID -echo $FSSTRESS_PROG -s 42 -d $d_top -p 4 -n 1000 -l100 -v > $seqres.full.2 -$FSSTRESS_PROG -s 42 -d $d_top -p 4 -n 1000 -l100 -v >> $seqres.full.2 2>&1 & +echo fsstress -s 42 -d $d_top -p 4 -n 1000 -l100 -v >> $seqres.full +_run_fsstress_bg -s 42 -d $d_top -p 4 -n 1000 -l100 -v +fsstress_pid_2=$_FSTRESS_PID +unset _FSSTRESS_PID ret=0 -if ! wait %1; then - echo "--------------------------------------" >>$seqres.full.1 - echo "fsstress on lower directory returned $? - see $seqres.full.1" - echo "--------------------------------------" >>$seqres.full.1 +if ! wait $fsstress_pid_1; then + echo "--------------------------------------" >>$seqres.full + echo "fsstress on lower directory returned $? - see $seqres.full" + echo "--------------------------------------" >>$seqres.full ret=1 fi +unset fsstress_pid_1 -if ! wait %2; then - echo "--------------------------------------" >>$seqres.full.2 - echo "fsstress on overlay directory returned $? - see $seqres.full.2" - echo "--------------------------------------" >>$seqres.full.2 +if ! wait $fsstress_pid_2; then + echo "--------------------------------------" >>$seqres.full + echo "fsstress on overlay directory returned $? - see $seqres.full" + echo "--------------------------------------" >>$seqres.full ret=1 fi - -cat $seqres.full.1 $seqres.full.2 > $seqres.full -rm $seqres.full.1 $seqres.full.2 +unset fsstress_pid_2 if [ "$ret" -eq 1 ]; then status=1 diff --git a/tests/overlay/021 b/tests/overlay/021 index 95a9ada5d..ee5a51007 100755 --- a/tests/overlay/021 +++ b/tests/overlay/021 @@ -33,8 +33,8 @@ d_low=$lowerdir/$testdir mkdir -p $d_low # Create 4K empty files in 4 directories -echo $FSSTRESS_PROG -d $d_low -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full -$FSSTRESS_PROG -d $d_low -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full 2>&1 +echo fsstress -d $d_low -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full +_run_fsstress -d $d_low -p 4 -z -f creat=1 -n 1024 -v echo "--------------------------------------" >> $seqres.full echo "Created 1K files in lower directory. " >> $seqres.full @@ -91,9 +91,9 @@ echo "Go team truncate!! " >> $seqres.full # Give team 'touch' a 1 second head start. # Team 'truncate' players should catch up after few copy up bombs. sleep 1 -$FSSTRESS_PROG -d $d_top -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full & +_run_fsstress -d $d_top -p 4 -z -f creat=1 -n 1024 -v -wait %1 %2 %3 %4 %5 +wait %1 %2 %3 %4 echo "Silence is golden" status=0 diff --git a/tests/xfs/006 b/tests/xfs/006 index 50b36947d..20fd104bc 100755 --- a/tests/xfs/006 +++ b/tests/xfs/006 @@ -13,9 +13,10 @@ _begin_fstest auto quick mount eio # Override the default cleanup function. _cleanup() { + _kill_fsstress + _dmerror_cleanup cd / rm -f $tmp.* - _dmerror_cleanup } # Import common functions. @@ -45,7 +46,7 @@ fi # start a metadata-intensive workload, but no data allocation operation. # Because uncompleted new space allocation I/Os may cause XFS to shutdown # after loading error table. -$FSSTRESS_PROG -z -n 5000 -p 10 \ +_run_fsstress -z -n 5000 -p 10 \ -f creat=10 \ -f resvsp=1 \ -f truncate=1 \ @@ -57,7 +58,7 @@ $FSSTRESS_PROG -z -n 5000 -p 10 \ -f unlink=1 \ -f symlink=1 \ -f rename=1 \ - -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1 + -d $SCRATCH_MNT/fsstress # Loading error table without "--nolockfs" option. Because "--nolockfs" # won't freeze fs, then some running I/Os may cause XFS to shutdown diff --git a/tests/xfs/011 b/tests/xfs/011 index df967f098..ed69879c5 100755 --- a/tests/xfs/011 +++ b/tests/xfs/011 @@ -26,8 +26,7 @@ _cleanup() { # Make sure $SCRATCH_MNT is unfreezed xfs_freeze -u $SCRATCH_MNT 2>/dev/null - $KILLALL_PROG -9 fsstress 2>/dev/null - wait + _kill_fsstress cd / rm -f $tmp.* } @@ -102,8 +101,7 @@ _scratch_mount _check_scratch_log_state -$FSSTRESS_PROG -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t \ - >> $seqres.full 2>&1 & +_run_fsstress_bg -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t iters=5 while [ $iters -gt 0 ]; do @@ -112,9 +110,7 @@ while [ $iters -gt 0 ]; do iters=$((iters - 1)) done -$KILLALL_PROG $FSSTRESS_PROG -wait - +_kill_fsstress _scratch_unmount status=0 diff --git a/tests/xfs/013 b/tests/xfs/013 index f4f406aa9..c68c6ad85 100755 --- a/tests/xfs/013 +++ b/tests/xfs/013 @@ -16,16 +16,6 @@ _begin_fstest auto metadata stress # Import common functions. . ./common/filter -# Override the default cleanup function. -_cleanup() -{ - $KILLALL_PROG -9 fsstress 2>/dev/null - wait - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - filter_enospc() { sed -e '/^.*No space left on device.*/d' } @@ -103,8 +93,7 @@ _create $SCRATCH_MNT/dir1 $COUNT _cleaner $SCRATCH_MNT $LOOPS $MINDIRS & # start a background stress workload on the fs -$FSSTRESS_PROG -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t \ - >> $seqres.full 2>&1 & +_run_fsstress_bg -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t # Each cycle clones the current directory and makes a random file replacement # pass on the new directory. The directory is copied to the next using hard @@ -127,8 +116,7 @@ do _rand_replace $SCRATCH_MNT/dir$((i+1)) $COUNT done -$KILLALL_PROG fsstress -wait +_kill_fsstress # clean out the competing fsstress allocations, then everything else rm -rf $SCRATCH_MNT/fsstress diff --git a/tests/xfs/017 b/tests/xfs/017 index c40d9cf09..263ecc753 100755 --- a/tests/xfs/017 +++ b/tests/xfs/017 @@ -9,15 +9,6 @@ . ./common/preamble _begin_fstest mount auto quick stress -_register_cleanup "_cleanup; rm -f $tmp.*" - -# Override the default cleanup function. -_cleanup() -{ - echo "*** unmount" - _scratch_unmount 2>/dev/null -} - # Import common functions. . ./common/filter @@ -41,8 +32,8 @@ echo "*** test" for l in 0 1 2 3 4 do echo " *** test $l" - FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full + FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -n 1000` + _run_fsstress $FSSTRESS_ARGS _try_scratch_mount -o remount,ro \ || _fail "remount ro failed" diff --git a/tests/xfs/017.out b/tests/xfs/017.out index 2d11c9492..e61793df1 100644 --- a/tests/xfs/017.out +++ b/tests/xfs/017.out @@ -7,4 +7,3 @@ QA output created by 017 *** test 3 *** test 4 *** done -*** unmount diff --git a/tests/xfs/032 b/tests/xfs/032 index 75edf0e9c..1ecc02fe0 100755 --- a/tests/xfs/032 +++ b/tests/xfs/032 @@ -50,7 +50,7 @@ while [ $SECTORSIZE -le $PAGESIZE ]; do fi _scratch_mount # light population of the fs - $FSSTRESS_PROG -n 100 -d $SCRATCH_MNT >> $seqres.full 2>&1 + _run_fsstress -n 100 -d $SCRATCH_MNT _scratch_unmount # Test "duplicate" copy at first, if $XFS_COPY_PROG won't do it. diff --git a/tests/xfs/049 b/tests/xfs/049 index 668ac3745..4163a144f 100755 --- a/tests/xfs/049 +++ b/tests/xfs/049 @@ -68,7 +68,7 @@ mount -t xfs -o loop $SCRATCH_MNT/test.xfs $SCRATCH_MNT/test >> $seqres.full 2>& || _fail "!!! failed to loop mount xfs" _log "stress" -$FSSTRESS_PROG -d $SCRATCH_MNT/test -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \ +_run_fsstress -d $SCRATCH_MNT/test -n 1000 \ || _fail "!!! stress failed" _log "clean" @@ -88,7 +88,7 @@ mount -t ext2 -o loop $SCRATCH_MNT/test/test.ext2 $SCRATCH_MNT/test2 >> $seqres. || _fail "!!! failed to loop mount xfs" _log "stress ext2 on xfs via loop" -$FSSTRESS_PROG -d $SCRATCH_MNT/test2 -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \ +_run_fsstress -d $SCRATCH_MNT/test2 -n 1000 \ || _fail "!!! stress ext2 failed" _log "clean" diff --git a/tests/xfs/051 b/tests/xfs/051 index 43fee4c45..bb9c36da8 100755 --- a/tests/xfs/051 +++ b/tests/xfs/051 @@ -11,15 +11,6 @@ . ./common/preamble _begin_fstest shutdown auto log metadata -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - _scratch_unmount > /dev/null 2>&1 -} - # Import common functions. . ./common/dmflakey @@ -37,11 +28,10 @@ _scratch_mount # Start a workload and shutdown the fs. The subsequent mount will require log # recovery. -$FSSTRESS_PROG -n 9999 -p 2 -w -d $SCRATCH_MNT &>> $seqres.full & +_run_fsstress_bg -n 9999 -p 2 -w -d $SCRATCH_MNT sleep 5 _scratch_shutdown -f -$KILLALL_PROG -q $FSSTRESS_PROG -wait +_kill_fsstress _scratch_unmount # Initialize a dm-flakey device that will pass I/Os for 5s and fail thereafter. diff --git a/tests/xfs/057 b/tests/xfs/057 index f1c947795..62eb8b93c 100755 --- a/tests/xfs/057 +++ b/tests/xfs/057 @@ -26,12 +26,12 @@ _begin_fstest auto log recoveryloop # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 [ -e /sys/fs/xfs/$sdev/errortag/log_item_pin ] && echo 0 > /sys/fs/xfs/$sdev/errortag/log_item_pin + _kill_fsstress wait > /dev/null 2>&1 + cd / + rm -f $tmp.* } # Import common functions. @@ -53,7 +53,7 @@ _scratch_mkfs_sized $((1024 * 1024 * 500)) >> $seqres.full 2>&1 _scratch_mount # populate the fs with some data and cycle the mount to reset the log head/tail -$FSSTRESS_PROG -d $SCRATCH_MNT -z -fcreat=1 -p 4 -n 100000 >> $seqres.full +_run_fsstress -d $SCRATCH_MNT -z -fcreat=1 -p 4 -n 100000 _scratch_cycle_mount || _fail "cycle mount failed" # Pin the tail and start a file removal workload. File removal tends to diff --git a/tests/xfs/077 b/tests/xfs/077 index 4a4ac4702..3d8ecd9f6 100755 --- a/tests/xfs/077 +++ b/tests/xfs/077 @@ -54,7 +54,7 @@ ORIG_UUID=`_scratch_xfs_db -c "uuid" | awk '{print $NF}'` _scratch_mount # Put some stuff on the fs -$FSSTRESS_PROG -d $SCRATCH_MNT -n 100 -p 4 >> $seqres.full 2>&1 +_run_fsstress -d $SCRATCH_MNT -n 100 -p 4 _scratch_unmount # Can xfs_db change it? diff --git a/tests/xfs/079 b/tests/xfs/079 index 46a15ed78..794d2db49 100755 --- a/tests/xfs/079 +++ b/tests/xfs/079 @@ -17,19 +17,9 @@ . ./common/preamble _begin_fstest shutdown auto log quick -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 -} - # Import common functions. . ./common/log - # Modify as appropriate. _require_scratch _require_v2log @@ -43,10 +33,10 @@ _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount "-o logbsize=32k" # Run a workload to dirty the log, wait a bit and shutdown the fs. -$FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 99999999 >> $seqres.full 2>&1 & +_run_fsstress_bg -d $SCRATCH_MNT -p 4 -n 99999999 sleep 10 _scratch_shutdown -f -wait +_wait_for_fsstress # Remount with a different log buffer size. Going from 32k to 64k increases the # log record extended header count, as the log record header can only handle 32k diff --git a/tests/xfs/104 b/tests/xfs/104 index 7f11f89a5..cd625d6b7 100755 --- a/tests/xfs/104 +++ b/tests/xfs/104 @@ -40,9 +40,8 @@ _stress_scratch() procs=3 nops=1000 # -w ensures that the only ops are ones which cause write I/O - FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs \ - -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1 & + args=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops` + _run_fsstress_bg $args } _require_scratch @@ -73,14 +72,11 @@ for i in `seq 125 -1 90`; do break done -# # Grow the filesystem while actively stressing it... -# Kick off more stress threads on each iteration, grow; repeat. -# while [ $size -le $endsize ]; do echo "*** stressing filesystem" echo "*** stressing a ${sizeb} block filesystem" >> $seqres.full - _stress_scratch + _stress_scratch sleep 1 size=`expr $size + $incsize` sizeb=`expr $size / $dbsize` # in data blocks @@ -92,10 +88,8 @@ while [ $size -le $endsize ]; do [ `expr $size % $modsize` -eq 0 ] && wait # every 4th iteration echo AGCOUNT=$agcount | tee -a $seqres.full echo && echo >> $seqres.full + _wait_for_fsstress done -wait # stop for any remaining stress processes - -_scratch_unmount status=0 exit diff --git a/tests/xfs/137 b/tests/xfs/137 index dfc653573..d97942bf6 100755 --- a/tests/xfs/137 +++ b/tests/xfs/137 @@ -29,7 +29,7 @@ _scratch_xfs_db -x -c "logformat -c 3" >> $seqres.full 2>&1 # do some work on the fs to update metadata LSNs _scratch_mount -$FSSTRESS_PROG -d $SCRATCH_MNT -n 999 -p 4 -w >> $seqres.full 2>&1 +_run_fsstress -d $SCRATCH_MNT -n 999 -p 4 -w _scratch_unmount # Reformat to the current cycle and try to mount. This fails in most cases diff --git a/tests/xfs/141 b/tests/xfs/141 index 5e9067e24..b630ba10d 100755 --- a/tests/xfs/141 +++ b/tests/xfs/141 @@ -14,19 +14,9 @@ . ./common/preamble _begin_fstest auto log metadata -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 -} - # Import common functions. . ./common/inject - # Modify as appropriate. _require_xfs_io_error_injection "log_bad_crc" _require_scratch @@ -49,7 +39,7 @@ while [ $nr_times -gt 0 ]; do # Run fsstress until the filesystem shuts down. It will shut down # automatically when error injection triggers. - $FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 999999 >> $seqres.full 2>&1 + _run_fsstress -d $SCRATCH_MNT -p 4 -n 999999 # Verify that we can remount the fs. Log recovery should handle the torn # write. diff --git a/tests/xfs/158 b/tests/xfs/158 index 3c4e60f0e..89bf8c851 100755 --- a/tests/xfs/158 +++ b/tests/xfs/158 @@ -31,7 +31,7 @@ _scratch_mkfs -m crc=1,inobtcount=0 >> $seqres.full _scratch_mount mkdir $SCRATCH_MNT/stress -$FSSTRESS_PROG -d $SCRATCH_MNT/stress -n 1000 >> $seqres.full +_run_fsstress -d $SCRATCH_MNT/stress -n 1000 echo moo > $SCRATCH_MNT/urk _scratch_unmount @@ -56,7 +56,7 @@ _check_scratch_xfs_features NEEDSREPAIR INOBTCNT echo "Filesystem should be usable again" _scratch_mount -$FSSTRESS_PROG -d $SCRATCH_MNT/stress -n 1000 >> $seqres.full +_run_fsstress -d $SCRATCH_MNT/stress -n 1000 _scratch_unmount _check_scratch_fs _check_scratch_xfs_features INOBTCNT diff --git a/tests/xfs/167 b/tests/xfs/167 index f9da261db..5ef2aa2ea 100755 --- a/tests/xfs/167 +++ b/tests/xfs/167 @@ -9,20 +9,12 @@ . ./common/preamble _begin_fstest rw metadata auto stress prealloc -# Override the default cleanup function. -_cleanup() -{ - $KILLALL_PROG -r -q -TERM fsstress 2> /dev/null - wait # ensures all fsstress processes died -} - workout() { procs=100 nops=15000 - FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p $procs -n $nops \ - $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full & + FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p $procs -n $nops` + _run_fsstress_bg $FSSTRESS_ARGS sleep 2 } @@ -52,6 +44,8 @@ rm -f $TEST_FILE workout $TEST_PROG $LOOPS $TEST_FILE +_kill_fsstress + echo " *** test done" status=0 diff --git a/tests/xfs/168 b/tests/xfs/168 index f187a336f..098e0c86a 100755 --- a/tests/xfs/168 +++ b/tests/xfs/168 @@ -38,9 +38,8 @@ stress_scratch() local procs=3 local nops=1000 # -w ensures that the only ops are ones which cause write I/O - local FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w \ - -p $procs -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1 + local args=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops` + _run_fsstress_bg $args } _require_scratch_xfs_shrink @@ -73,7 +72,7 @@ while [ $totalcount -gt 0 ]; do decsize=`expr 41 \* 1048576 + 1 + $RANDOM \* $RANDOM % 1048576` while [ $size -gt $endsize ]; do - stress_scratch & + stress_scratch sleep 1 decb=`expr $decsize / $dbsize` # in data blocks @@ -95,6 +94,7 @@ while [ $totalcount -gt 0 ]; do . $tmp.growfs size=`expr $dblocks \* $dbsize` + _kill_fsstress _scratch_unmount _scratch_xfs_repair -n >> $seqres.full 2>&1 || \ _fail "xfs_repair failed with shrinking $sizeb" diff --git a/tests/xfs/264 b/tests/xfs/264 index 109fecd1c..a6e816d3c 100755 --- a/tests/xfs/264 +++ b/tests/xfs/264 @@ -55,7 +55,7 @@ do_test() # start a metadata-intensive workload, but no data allocation operation. # Because uncompleted new space allocation I/Os may cause XFS to shutdown # after loading error table. - $FSSTRESS_PROG -z -n 5000 -p 10 \ + _run_fsstress -z -n 5000 -p 10 \ -f creat=10 \ -f resvsp=1 \ -f truncate=1 \ @@ -67,7 +67,7 @@ do_test() -f unlink=1 \ -f symlink=1 \ -f rename=1 \ - -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1 + -d $SCRATCH_MNT/fsstress # Loading error table without "--nolockfs" option. Because "--nolockfs" # won't freeze fs, then some running I/Os may cause XFS to shutdown diff --git a/tests/xfs/270 b/tests/xfs/270 index 3744df5a9..d3bce386a 100755 --- a/tests/xfs/270 +++ b/tests/xfs/270 @@ -80,7 +80,7 @@ if [ $? -ne 0 ]; then else # no hang/panic is fine cat $SCRATCH_MNT/testfile > /dev/null - $FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 400 >>$seqres.full 2>&1 + _run_fsstress -d $SCRATCH_MNT -p 4 -n 400 fi # remount as rw, kernel should reject it diff --git a/tests/xfs/297 b/tests/xfs/297 index 2c5b03c5c..66c5d0cc7 100755 --- a/tests/xfs/297 +++ b/tests/xfs/297 @@ -16,8 +16,7 @@ _cleanup() { # Make sure $SCRATCH_MNT is unfreezed xfs_freeze -u $SCRATCH_MNT 2>/dev/null - $KILLALL_PROG -q -9 $FSSTRESS_PROG - wait + _kill_fsstress cd / rm -f $tmp.* } @@ -37,7 +36,7 @@ _scratch_mount STRESS_DIR="$SCRATCH_MNT/testdir" mkdir -p $STRESS_DIR -$FSSTRESS_PROG -d $STRESS_DIR -n 100 -p 1000 $FSSTRESS_AVOID >>$seqres.full & +_run_fsstress_bg -d $STRESS_DIR -n 1000 -p 1000 $FSSTRESS_AVOID # Freeze/unfreeze file system randomly echo "Start freeze/unfreeze randomly" | tee -a $seqres.full @@ -60,8 +59,7 @@ while [ $LOOP -gt 0 ];do let LOOP=$LOOP-1 done echo "Test done" | tee -a $seqres.full -$KILLALL_PROG -q $FSSTRESS_PROG -wait +_kill_fsstress status=0 exit diff --git a/tests/xfs/305 b/tests/xfs/305 index 0ad3ef7fb..6371ed8a6 100755 --- a/tests/xfs/305 +++ b/tests/xfs/305 @@ -4,7 +4,7 @@ # # FS QA Test No. 305 # -# Test to verify that turn group/project quotas off while fstress and +# Test to verify that turn group/project quotas off while fsstress and # user quotas are left on. # . ./common/preamble @@ -18,7 +18,6 @@ _begin_fstest auto quota _require_scratch _require_xfs_quota -_require_command "$KILLALL_PROG" killall _scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1 @@ -33,12 +32,11 @@ _exercise() _qmount mkdir -p $QUOTA_DIR - $FSSTRESS_PROG -d $QUOTA_DIR -n 1000000 -p 100 $FSSTRESS_AVOID >>$seqres.full & + _run_fsstress_bg -d $QUOTA_DIR -n 1000000 -p 100 sleep 10 $XFS_QUOTA_PROG -x -c "disable -$type" $SCRATCH_DEV sleep 5 - $KILLALL_PROG -q $FSSTRESS_PROG - wait + _kill_fsstress } echo "*** turn off group quotas" diff --git a/tests/xfs/442 b/tests/xfs/442 index 77d08fda5..5cbd8dd19 100755 --- a/tests/xfs/442 +++ b/tests/xfs/442 @@ -12,14 +12,6 @@ . ./common/preamble _begin_fstest auto stress clone quota -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 -} - # Import common functions. . ./common/quota . ./common/filter @@ -72,7 +64,7 @@ _scratch_mount >> $seqres.full 2>&1 nr_cpus=$((LOAD_FACTOR * 4)) nr_ops=$((25000 * nr_cpus * TIME_FACTOR)) -$FSSTRESS_PROG $FSSTRESS_AVOID -w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus >> $seqres.full +_run_fsstress -w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus echo "Check quota before remount" check_quota_du_blocks diff --git a/tests/xfs/538 b/tests/xfs/538 index 57113d341..f858cadc3 100755 --- a/tests/xfs/538 +++ b/tests/xfs/538 @@ -46,7 +46,7 @@ echo "Inject bmap_alloc_minlen_extent error tag" _scratch_inject_error bmap_alloc_minlen_extent 1 echo "Execute fsstress" -$FSSTRESS_PROG -d $SCRATCH_MNT \ +_run_fsstress -d $SCRATCH_MNT \ $(_scale_fsstress_args -p 75 -n 1000) \ -f bulkstat=0 \ -f bulkstat1=0 \ @@ -61,7 +61,7 @@ $FSSTRESS_PROG -d $SCRATCH_MNT \ -f readv=0 \ -f stat=0 \ -f aread=0 \ - -f dread=0 >> $seqres.full + -f dread=0 # success, all done status=0 diff --git a/tests/xfs/609 b/tests/xfs/609 index c23b6893d..88dc3c683 100755 --- a/tests/xfs/609 +++ b/tests/xfs/609 @@ -18,21 +18,12 @@ _stress_scratch() nops=999999 # -w ensures that the only ops are ones which cause write I/O FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs \ - -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1 & + -n $nops` + _run_fsstress_bg $FSSTRESS_ARGS >> $seqres.full 2>&1 } _require_scratch _require_command "$XFS_GROWFS_PROG" xfs_growfs -_require_command "$KILLALL_PROG" killall - -_cleanup() -{ - $KILLALL_ALL fsstress > /dev/null 2>&1 - wait - cd / - rm -f $tmp.* -} _scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs . $tmp.mkfs # extract blocksize and data size for scratch device @@ -63,12 +54,7 @@ while [ $size -le $endsize ]; do sleep $((RANDOM % 3)) _scratch_shutdown - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress _scratch_cycle_mount done > /dev/null 2>&1 wait # stop for any remaining stress processes diff --git a/tests/xfs/610 b/tests/xfs/610 index 23fbd8585..8610b912c 100755 --- a/tests/xfs/610 +++ b/tests/xfs/610 @@ -18,22 +18,13 @@ _stress_scratch() nops=999999 # -w ensures that the only ops are ones which cause write I/O FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs \ - -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1 & + -n $nops` + _run_fsstress_bg $FSSTRESS_ARGS >> $seqres.full 2>&1 } _require_scratch _require_realtime _require_command "$XFS_GROWFS_PROG" xfs_growfs -_require_command "$KILLALL_PROG" killall - -_cleanup() -{ - $KILLALL_ALL fsstress > /dev/null 2>&1 - wait - cd / - rm -f $tmp.* -} _scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs . $tmp.mkfs # extract blocksize and data size for scratch device @@ -65,12 +56,7 @@ while [ $size -le $endsize ]; do sleep $((RANDOM % 3)) _scratch_shutdown - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress _scratch_cycle_mount done > /dev/null 2>&1 wait # stop for any remaining stress processes From patchwork Wed Nov 27 04:51:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886546 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B62C13A899 for ; Wed, 27 Nov 2024 04:54:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683251; cv=none; b=CwGweJKVdOSc8Yzl4Xj9IFqG50JslIdTQ8a+G52xAxTXxNWa79XjY0r0WWpJExZYOqETv6iR9ccA5+QhL0W/5ncCroGZAQQ5x4i+erZisl/rPBg+rHpARpyXl15j2lGnzoMLmQoFptN5VPb3DN7zTmYjJTlDjmUsg9fvsmJBJUo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683251; c=relaxed/simple; bh=urXtjPN7x3KgjxaFASLjGM4sO3guAuua/An+IgQ+v8o=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kCuDhgkI0POrUcBxx00dpuuhCwmG8XOq7hTRET0+l/T8FhfweEHazJb2oLcf/Deleu2qY+FZcOopbHj3YbH/I5/lV2/lISIPrkaGE2DV2SlRhyocwaTzFR1d3GZ8i9Oh+9V8NIiU1FWyMN2b+6lzh+RldBVhoWYcMbF8lDdp8Bw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=aTNStqx3; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="aTNStqx3" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-7eae96e6624so4959199a12.2 for ; Tue, 26 Nov 2024 20:54:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683249; x=1733288049; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=/aYUvNV0CSbt1n5IbjmJUMv5LqmwReocYnG4276zIaQ=; b=aTNStqx3aGALKLkhyhG3V4om09JdaXmvOggkLfwUOrIHkVgqYCu+YJWoWFwushOw/G BOvKdVC2KTl4qYIIEohdFQb5t+EsiVU8QkbjnrUWsGTY7bqRU8S2N76e7IDIwPefFScv HmzKCmZhVxhsnNuV9An/rQrizKBdOS+eLJePhflrRzvaK/KuwibHICQVTeQ5aL9gOV2F aGgZfjItMzfyN61DNQ7VUX+FBO3FE8Bhi6kGxqa469mv3o92s2hVqpDuY6hsM+2cCb0k /TStgXfyvisg8SWUBFPjh5JSsd7xOTMn2nzIit4fj4F2/ncQgFK+4iBhtJhsJ3UYQ5Bz z23w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683249; x=1733288049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/aYUvNV0CSbt1n5IbjmJUMv5LqmwReocYnG4276zIaQ=; b=mK4O8eJCE/1m0aB/XHyOKDjfJ1wRGwbXlmcd8mmHEywCYz5cDv84P7CUxFUNeKlGmB Rjjlf845D/R0umK/RRbJdWhf/5R0jJOEb3+dlIEIDTDuJT1xEejgNl74QkOPioB+3Sf0 osQWDyg/bJIOE3ut5bHpShlc1t69GXA1hrmy6JKgjoOqX78ujzStPLc43fMgxCNR2GUN CC4hCmur8x75ZFUBuze7u5kr6ao2TJvNhGsQdRSa0Av+H/OcqenkpjO0L77HEklAr2aF kQemmKf0yaaoft600MMHXLFPIaFjw9rqBvP11BSZwLFdv1F9o2QWN0FTV4E8Ik4koYxF VnDw== X-Gm-Message-State: AOJu0YwfqjIB1IGcmkENpNuwLuLCouXpO0JCMYcIgVxS/tBSlD1PYIHt tmBxtT+ssed2cvgqEOdWjNYMjrDnzYE101MAPLyEn9RML8w0VaPqExxAKk8eXa5OzAOmH49otgA W X-Gm-Gg: ASbGnct1exGUy5TE4a7IFBJ5Mju+Mb/jHTZGVL++TmchUIC4Sy9tmxBztaB+OsTn3MV FKU1t1M2PR74kKZkArKCGpGXebhSWZcgkvTp3w9/WHMAQDrwLGTcQjXtrzvP5ZBfVTW5FCK0BeO kVBO3Cf6ufs0u81NyNtIR0Sj3WRjfblnNoHlSTUvPrNwGG0eVakZOpdKMThuzuZQf9atzTkh31b nYOltxGJalOfJIIolLF7h50hSpUNSHVnbzmq/D/5CezF+C02QhRhOc2EeurT3Gl/RwfyiU67XZu ao6b7y8xJdr2VfXmD6z705Ap X-Google-Smtp-Source: AGHT+IGebmkvaiob13ei2AVo8oGoCUVLDalhK34KRIutvNsnDDG0UFQVAKDFVX/Jd2RQsKWNyv6H2A== X-Received: by 2002:a05:6a20:4303:b0:1e0:da2f:9dc2 with SMTP id adf61e73a8af0-1e0e0c033dbmr3611137637.40.1732683249558; Tue, 26 Nov 2024 20:54:09 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee0fa5fff0sm488629a91.21.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:07 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3w-00000003ZTy-37tb for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3w-0000000FQdf-3gKZ for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:04 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 03/40] fuzzy: don't use killall Date: Wed, 27 Nov 2024 15:51:33 +1100 Message-ID: <20241127045403.3665299-4-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Having test cleanup call 'killall xfs_io fsx xfs_scrub' results in a system wide process kill, rather than just the processes the test is running directly. Make sure we only kill processes the fuzz test directly owns. We can do this with 'pkill --parent $$ ' to limit the search for processes to kill to just the children of the current process. Signed-off-by: Dave Chinner --- common/fuzzy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/fuzzy b/common/fuzzy index 9181520a3..3a7f04aae 100644 --- a/common/fuzzy +++ b/common/fuzzy @@ -1145,7 +1145,6 @@ __stress_scrub_fsstress_loop() { _require_xfs_stress_scrub() { _require_xfs_io_command "scrub" _require_test_program "xfsfind" - _require_command "$KILLALL_PROG" killall _require_freeze command -v _filter_scratch &>/dev/null || \ _notrun 'xfs scrub stress test requires common/filter' @@ -1178,7 +1177,9 @@ _scratch_xfs_stress_scrub_cleanup() { # distorts the golden output. echo "Killing stressor processes at $(date)" >> $seqres.full _kill_fsstress - $KILLALL_PROG -INT xfs_io fsx xfs_scrub >> $seqres.full 2>&1 + pkill -INT --parent $$ xfs_io >> $seqres.full 2>&1 + pkill -INT --parent $$ fsx >> $seqres.full 2>&1 + pkill -INT --parent $$ xfs_scrub >> $seqres.full 2>&1 # Tests are not allowed to exit with the scratch fs frozen. If we # started a fs freeze/thaw background loop, wait for that loop to exit From patchwork Wed Nov 27 04:51:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886545 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F019A82D66 for ; Wed, 27 Nov 2024 04:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683251; cv=none; b=s8Y7ar43xoduskniiaFg6BE3kJ/MlzGf+UZpcTpY8xgLdpzEjiBsiPlRyXA/eO9rvdnqiBit0WNaN5I1wWoL1yV+yn9p7matgwFMYonmFzz6D84uM9RdjQU86Xy3ICWyF94js0xy42T4fmlTD+/53ye3IaQ6ftaCJCoA5GIw2TA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683251; c=relaxed/simple; bh=Hod13QZkImKDJX7MYTYn/s7zXtiIaGjSn6BfU7wMwwM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SbiGkkkOxg7JevWXP+sq5etH6dDp6s/YPEZzkuONZ93zOuunKYh9vdmM1lFlrJEEzDVbIpOnVrUHBJ3LKLNuVzDZOHGKQa25joMXKTt0eM2MX+yLoV+bytD5AEdheOezBipqu+tf7tYTal7xfO2EvvVk2rHasePpEnmBBfTbCWQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=rRHxuZqx; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="rRHxuZqx" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2ea6d689d22so5000367a91.1 for ; Tue, 26 Nov 2024 20:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683249; x=1733288049; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=AiBK6qpVXJRXgGlUJIO5e/7E7v+qgDlPAlQ4WFGhHD8=; b=rRHxuZqxY4ijhLq+zgKyonIKpQdRV8LSzi7gDy+DZ5BbymlFdONazjW/rSj9TkIUJX rz7eX8LeK8BjEVUugJF5Gvlg2O0kq2vr7hGN6mFbs8lfnCi1Ina2JOUOl6L4JLurG7Ah BvF/lorIC1P6wJEgBQOUKB2Sen0bjjKRKfocYFpeN0wVVs8I7Z6+V7sJViqSDb1cEqiN ZUF6pKICHOceF5+sTvXckfwd7ZhntQYQVmUxI3agFZ0gvDIjgb0JDhik4YjHok2Uttx5 CUttUf44QNxXDgfVn+UDz9/wrzKUOB3ibExTPOa5voEAgVrSlKAZEZ2g7t6Udo6Rjyer Djuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683249; x=1733288049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AiBK6qpVXJRXgGlUJIO5e/7E7v+qgDlPAlQ4WFGhHD8=; b=ZRnPXRFysjmHRHQEhimvH7AC7glOV124MyjjSiToKWsuHdg+wN43ev9nAzrl3pGv16 PcyfU04SgSxgEQAyp/IoGPKpHo5Z4b8mH31T8limlJH2MMzVnfAuOF1JRv8kPw4Th6XG vxweGWbB7ekpLrNn3AYYxGwrKXQZfBi3pzbe7I10HFBJWi7qqQ5DBM69k7+RMqf+Fsab QXlxMdHCwM0vGDSvRzGfSsjTBbRv71JJbOHSBvjU48T3cyGB5WW8EkM5qxhUgATddEha ZJcR+otrzMDQ2he5NA+H1/Z87EqZj991dpURYFXCmgv3X3/eKCQZbD8P7JccsBPsmZTZ 01ew== X-Gm-Message-State: AOJu0YyOP5bGSuip55EOVx6ywtHSMlklLClroK4yk1exY4uZDz/F4u5e Rq0AFpuNQoGlz4r6pHvdPTdW84Kz4D1FJ2qDAIVBoQ5RWM9CtMJ61/tpwl9YNFO8cbrfRPXsJN2 j X-Gm-Gg: ASbGncs3UFG4Z34JfZLE75IfULBx08EU5bFGASq/2T10dObXWgNJzGpnFq5JqW+zp5a miKoZ2OZOFYkK3tGV5jjf1muP84QeJqQSvtureB+CTzjP5K11Qyq+QYotg4mTcgaYZ4kUaXUMH8 KTvGs34vKqeQOmtQTzVboSlNxvbSwIN8oMWZyFFxs5Fi/H1zAfBkM9oRcAMNKaks0Ump9M2K2B/ H1CCXQXz9tX90d2xiXXmD05a/9aA9g2p4jeO8ARb64OSDepoTAxRYpbihGaJENf1EoKmmJWhHy7 SGi4X49yvR3UyKRVq3CUDP82 X-Google-Smtp-Source: AGHT+IEzQoqPKnbcJLKpsqPuRN5h8PLn0X7i9yge39xjgGn55toG1TvhN277nn2G7Y/ICXugFnHD3w== X-Received: by 2002:a17:90b:3847:b0:2ea:6f19:1804 with SMTP id 98e67ed59e1d1-2ee097bd204mr2095831a91.25.1732683249170; Tue, 26 Nov 2024 20:54:09 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee0fad03b1sm486134a91.35.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:07 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3w-00000003ZU5-3IDH for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3w-0000000FQdk-3q7j for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:04 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 04/40] fstests: per-test dmflakey instances Date: Wed, 27 Nov 2024 15:51:34 +1100 Message-ID: <20241127045403.3665299-5-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner We can't run two tests that use dmflakey at the same time because the device name is the same. hence they interfere with each other. Given dmflakey devices their own per-test names to avoid this problem. Also, drop_and_remount is about to fail the fs during unmount, so ensure the filesystem is going to fail the IO during unmount rather than retrying forever. Signed-off-by: Dave Chinner --- common/dmflakey | 56 ++++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/common/dmflakey b/common/dmflakey index 52da3b100..75a0a67c8 100644 --- a/common/dmflakey +++ b/common/dmflakey @@ -8,15 +8,19 @@ FLAKEY_ALLOW_WRITES=0 FLAKEY_DROP_WRITES=1 FLAKEY_ERROR_WRITES=2 +export FLAKEY_NAME="flakey-test.$seq" +export FLAKEY_RTNAME="flakey-rttest.$seq" +export FLAKEY_LOGNAME="flakey-logtest.$seq" + _init_flakey() { # Scratch device local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` - FLAKEY_DEV=/dev/mapper/flakey-test + export FLAKEY_DEV="/dev/mapper/$FLAKEY_NAME" FLAKEY_TABLE="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 180 0" FLAKEY_TABLE_DROP="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 0 180 1 drop_writes" FLAKEY_TABLE_ERROR="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 0 180 1 error_writes" - _dmsetup_create flakey-test --table "$FLAKEY_TABLE" || \ + _dmsetup_create $FLAKEY_NAME --table "$FLAKEY_TABLE" || \ _fatal "failed to create flakey device" # Realtime device @@ -25,7 +29,7 @@ _init_flakey() # Set up the device switch local backing_dev="$SCRATCH_RTDEV" export NON_FLAKEY_RTDEV="$SCRATCH_RTDEV" - SCRATCH_RTDEV=/dev/mapper/flakey-rttest + SCRATCH_RTDEV=/dev/mapper/$FLAKEY_RTNAME else # Already set up; recreate tables local backing_dev="$NON_FLAKEY_RTDEV" @@ -34,7 +38,7 @@ _init_flakey() FLAKEY_RTTABLE="0 $BLK_DEV_SIZE flakey $backing_dev 0 180 0" FLAKEY_RTTABLE_DROP="0 $BLK_DEV_SIZE flakey $backing_dev 0 0 180 1 drop_writes" FLAKEY_RTTABLE_ERROR="0 $BLK_DEV_SIZE flakey $backing_dev 0 0 180 1 error_writes" - _dmsetup_create flakey-rttest --table "$FLAKEY_RTTABLE" || \ + _dmsetup_create $FLAKEY_RTNAME --table "$FLAKEY_RTTABLE" || \ _fatal "failed to create flakey rt device" fi @@ -44,7 +48,7 @@ _init_flakey() # Set up the device switch local backing_dev="$SCRATCH_LOGDEV" export NON_FLAKEY_LOGDEV="$SCRATCH_LOGDEV" - SCRATCH_LOGDEV=/dev/mapper/flakey-logtest + SCRATCH_LOGDEV=/dev/mapper/$FLAKEY_LOGNAME else # Already set up; recreate tables local backing_dev="$NON_FLAKEY_LOGDEV" @@ -53,7 +57,7 @@ _init_flakey() FLAKEY_LOGTABLE="0 $BLK_DEV_SIZE flakey $backing_dev 0 180 0" FLAKEY_LOGTABLE_DROP="0 $BLK_DEV_SIZE flakey $backing_dev 0 0 180 1 drop_writes" FLAKEY_LOGTABLE_ERROR="0 $BLK_DEV_SIZE flakey $backing_dev 0 0 180 1 error_writes" - _dmsetup_create flakey-logtest --table "$FLAKEY_LOGTABLE" || \ + _dmsetup_create $FLAKEY_LOGNAME --table "$FLAKEY_LOGTABLE" || \ _fatal "failed to create flakey log device" fi } @@ -74,15 +78,15 @@ _cleanup_flakey() { # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang - test -n "$NON_FLAKEY_LOGDEV" && $DMSETUP_PROG resume flakey-logtest &> /dev/null - test -n "$NON_FLAKEY_RTDEV" && $DMSETUP_PROG resume flakey-rttest &> /dev/null + test -n "$NON_FLAKEY_LOGDEV" && $DMSETUP_PROG resume $FLAKEY_LOGNAME &> /dev/null + test -n "$NON_FLAKEY_RTDEV" && $DMSETUP_PROG resume $FLAKEY_RTNAME &> /dev/null $DMSETUP_PROG resume flakey-test > /dev/null 2>&1 $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - _dmsetup_remove flakey-test - test -n "$NON_FLAKEY_LOGDEV" && _dmsetup_remove flakey-logtest - test -n "$NON_FLAKEY_RTDEV" && _dmsetup_remove flakey-rttest + _dmsetup_remove $FLAKEY_NAME + test -n "$NON_FLAKEY_LOGDEV" && _dmsetup_remove $FLAKEY_LOGNAME + test -n "$NON_FLAKEY_RTDEV" && _dmsetup_remove $FLAKEY_RTNAME if [ -n "$NON_FLAKEY_LOGDEV" ]; then SCRATCH_LOGDEV="$NON_FLAKEY_LOGDEV" @@ -125,54 +129,58 @@ _load_flakey_table() # Suspend the scratch device before the log and realtime devices so # that the kernel can freeze and flush the filesystem if the caller # wanted a freeze. - $DMSETUP_PROG suspend $suspend_opt flakey-test - [ $? -ne 0 ] && _fatal "failed to suspend flakey-test" + $DMSETUP_PROG suspend $suspend_opt $FLAKEY_NAME + [ $? -ne 0 ] && _fatal "failed to suspend $FLAKEY_NAME" if [ -n "$NON_FLAKEY_RTDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt flakey-rttest + $DMSETUP_PROG suspend $suspend_opt $FLAKEY_RTNAME [ $? -ne 0 ] && _fatal "failed to suspend flakey-rttest" fi if [ -n "$NON_FLAKEY_LOGDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt flakey-logtest + $DMSETUP_PROG suspend $suspend_opt $FLAKEY_LOGNAME [ $? -ne 0 ] && _fatal "failed to suspend flakey-logtest" fi # There may be multiple dm targets in the table, and these dm targets # will be joined by the newline ("\n"). Option --table can not cope with # the multiple-targets case, so get them by reading from standard input. - echo -e "$table" | $DMSETUP_PROG load flakey-test - [ $? -ne 0 ] && _fatal "failed to load table into flakey-test" + echo -e "$table" | $DMSETUP_PROG load $FLAKEY_NAME + [ $? -ne 0 ] && _fatal "failed to load table into $FLAKEY_NAME" if [ -n "$NON_FLAKEY_RTDEV" ]; then - echo -e "$rttable" | $DMSETUP_PROG load flakey-rttest + echo -e "$rttable" | $DMSETUP_PROG load $FLAKEY_RTNAME [ $? -ne 0 ] && _fatal "failed to load table into flakey-rttest" fi if [ -n "$NON_FLAKEY_LOGDEV" ]; then - echo -e "$logtable" | $DMSETUP_PROG load flakey-logtest + echo -e "$logtable" | $DMSETUP_PROG load $FLAKEY_LOGNAME [ $? -ne 0 ] && _fatal "failed to load table into flakey-logtest" fi # Resume devices in the opposite order that we suspended them. if [ -n "$NON_FLAKEY_LOGDEV" ]; then - $DMSETUP_PROG resume flakey-logtest + $DMSETUP_PROG resume $FLAKEY_LOGNAME [ $? -ne 0 ] && _fatal "failed to resume flakey-logtest" fi if [ -n "$NON_FLAKEY_RTDEV" ]; then - $DMSETUP_PROG resume flakey-rttest + $DMSETUP_PROG resume $FLAKEY_RTNAME [ $? -ne 0 ] && _fatal "failed to resume flakey-rttest" fi - $DMSETUP_PROG resume flakey-test - [ $? -ne 0 ] && _fatal "failed to resume flakey-test" + $DMSETUP_PROG resume $FLAKEY_NAME + [ $? -ne 0 ] && _fatal "failed to resume $FLAKEY_NAME" } # Silently drop all writes and unmount/remount to simulate a crash/power # failure. _flakey_drop_and_remount() { + # If the full environment is set up, configure ourselves for shutdown + type _prepare_for_eio_shutdown &>/dev/null && \ + _prepare_for_eio_shutdown $FLAKEY_DEV + _load_flakey_table $FLAKEY_DROP_WRITES _unmount_flakey @@ -188,7 +196,7 @@ _require_flakey_with_error_writes() { local SIZE local TABLE - local NAME=flakey-test + local NAME=$FLAKEY_NAME _require_dm_target flakey From patchwork Wed Nov 27 04:51:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886553 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4ABA713C9D9 for ; Wed, 27 Nov 2024 04:54:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683254; cv=none; b=QQZnB2TeW6dmXUm7z9pGqnHVOtmVpoLASb7fSE6vef4ekgFIrreUX+OZhAAraoOmf0o72tFfiJ5YXXrHbreqcNdtw20dxaJ1eCbiuf/VYeXlL2LeaprywvolZk9k+TDqpEdaLW3Wzc7lWWVsmjxGfLfwpPvRwGpwe+Bvm+kpqsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683254; c=relaxed/simple; bh=yrbAeZcHGwxIKMaPxcPfrO0FmQ9blzj5ASMWZUlD4I4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VDTtO+gbmw1RicEm8MgBoD/JPKfzxB/qnisiSdSRQKfCELZfJbtt+5lbNlBQ2od/PQ2yPGLWa4PvaWX4n2UbkKXTA7dnAnWKfMYab/5txEW141Px+vYbZgUrWDtPrHzn8eNM9MsAbZ5czdBrEUtZnYXH4KLl2DZkZBPZV1jowUs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=Judm8D7U; arc=none smtp.client-ip=209.85.215.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="Judm8D7U" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-7fc8f0598cdso118270a12.1 for ; Tue, 26 Nov 2024 20:54:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683252; x=1733288052; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=CswRdGJcaZYprnG/h2H6fs0YhxASIvmhxSuPCYlDdEA=; b=Judm8D7UbmlR1izV/IfW5djHvi5yQ/QhEHyC1FpWy6MLuRomVsOxYu5H5dX0G3iE8k +et43j138uJr5cmhZUnemnWqd5KOhk5Udn7rkRtCMZPVxZoJINQd/nezWEt3Y9q/6v38 vBv78TD2LOuTCT1iWYM3xn/a0JSvocnHp/8/y1PXYYDTbmhAQwbguaSL/j5Z2GGKT731 56FqjDkNJUTF36j7FU1wxGOFF04SewXANdD0hMVXcTl3F/O7AMTg+g8fYlQkznsJ6R1S iYauftELuBJ24EsLuyal8cJGC/NvS7S21wMSPbCPH5PUcxzdWS9WTOXdGfvEca4TyqQ+ rUkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683252; x=1733288052; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CswRdGJcaZYprnG/h2H6fs0YhxASIvmhxSuPCYlDdEA=; b=QE40Z/nmzx8mQOX5HDAwK0XLRVVSG5uYJGda8pa4bydi9mli3pcRg1oCZURRCoWW4a eDkRCka/fPFGP/k2qQfPZJUl54qMWbr569trJiJ6bCT/beV+yQqnkmN4nx2XcByj2P9p JiFBv7MAFg9WIDoGXAD4mK+yO4/IROlgeRtrxkC7z/0/YPt0917pSh8zcGIUIPWMqnG3 6ot7olYjQAOLp6DXzd6tsH943OgUkkD5X3ZwDu4ZldIxxQMjEAU7F0qKol+8wADHIlQd JoDKKp9bcQE2fPloseOiDGAZ66QWiXM7dBAEv2uvc5t/H1XZtrUjGWT671nyCzvXU3Bl OMxg== X-Gm-Message-State: AOJu0Yz8h3hC8dGn4b+Qgy39ZLElzEBnh3o1RdPF+TBFeAwYKJMfGufk XH8f4TxI/ValE/hb+OuVf0A2wPTu91tytlPZZDjl3EpIdj+tq4BiZ6KHp/g3uN5Tfkd2FNnbGVl M X-Gm-Gg: ASbGncscWDrgKiP2p6w30bpk9N+i97bGrloiYLKuw1JPkRfEYCnZELefGUQE2cEgb22 H0S8Jxp4ruMZsja3gKPx3tT8wdrftN+V/wYeAyvsUuCDNgX+1o0rN08dRQCsRkLXb+QMYk5sZ8+ MobDxXFXRsazwCGZzDR+c+pzED3qjgPl4EGgUuDu/W5Wf9mP31nLpmMunsBSAG4qDdPYrfn5gOW OOBsn2+0XToMiikdci9T8f4btB9UNdxF28CFr9rMDmzEVh8NaSxnU+6rMm4GMAbqFDF4OxC8rHS 8p/GBeCxsf6Cvsmsu2oTh2uN X-Google-Smtp-Source: AGHT+IF+yiBf+KY92XTiquQIWXrvI7Imo38lgwFEKL44UxZQV5obnMinCVontUvcVxlsq2RkQHu5+Q== X-Received: by 2002:a05:6a21:32a5:b0:1cf:651c:52f1 with SMTP id adf61e73a8af0-1e0d664eb46mr9777657637.0.1732683252210; Tue, 26 Nov 2024 20:54:12 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fbcc3fae30sm9648906a12.76.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:09 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3w-00000003ZU9-3UVS for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3w-0000000FQdp-42dq for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:04 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 05/40] fstests: per-test dmerror instances Date: Wed, 27 Nov 2024 15:51:35 +1100 Message-ID: <20241127045403.3665299-6-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We can't run two tests that use dmerror at the same time because the device name is the same. hence they interfere with each other. Give dmerror devices their own per-test names to avoid this problem. Note that we need a hack to pass the test sequence number through to src/dmerror as used by generic/441 so that it can construct the dmerror name correctly. Signed-off-by: Dave Chinner --- common/dmerror | 70 +++++++++++++++++++++++++---------------------- src/dmerror | 6 +++- tests/generic/441 | 2 +- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/common/dmerror b/common/dmerror index 3494b6dd3..97796b38e 100644 --- a/common/dmerror +++ b/common/dmerror @@ -4,6 +4,10 @@ # # common functions for setting up and tearing down a dmerror device +export DMERROR_NAME="error-test.$seq" +export DMERROR_RTNAME="error-rttest.$seq" +export DMERROR_LOGNAME="error-logtest.$seq" + _dmerror_setup_vars() { local backing_dev="$1" @@ -31,7 +35,7 @@ _dmerror_setup() done # Scratch device - export DMERROR_DEV='/dev/mapper/error-test' + export DMERROR_DEV="/dev/mapper/$DMERROR_NAME" _dmerror_setup_vars $SCRATCH_DEV # Realtime device. We reassign SCRATCH_RTDEV so that all the scratch @@ -41,7 +45,7 @@ _dmerror_setup() # Set up the device switch local dm_backing_dev=$SCRATCH_RTDEV export NON_ERROR_RTDEV="$SCRATCH_RTDEV" - SCRATCH_RTDEV='/dev/mapper/error-rttest' + SCRATCH_RTDEV="/dev/mapper/$DMERROR_RTNAME" else # Already set up; recreate tables local dm_backing_dev="$NON_ERROR_RTDEV" @@ -57,7 +61,7 @@ _dmerror_setup() # Set up the device switch local dm_backing_dev=$SCRATCH_LOGDEV export NON_ERROR_LOGDEV="$SCRATCH_LOGDEV" - SCRATCH_LOGDEV='/dev/mapper/error-logtest' + SCRATCH_LOGDEV="/dev/mapper/$DMERROR_LOGNAME" else # Already set up; recreate tables local dm_backing_dev="$NON_ERROR_LOGDEV" @@ -71,19 +75,19 @@ _dmerror_init() { _dmerror_setup "$@" - _dmsetup_remove error-test - _dmsetup_create error-test --table "$DMLINEAR_TABLE" || \ + _dmsetup_remove $DMERROR_NAME + _dmsetup_create $DMERROR_NAME --table "$DMLINEAR_TABLE" || \ _fatal "failed to create dm linear device" if [ -n "$NON_ERROR_RTDEV" ]; then - _dmsetup_remove error-rttest - _dmsetup_create error-rttest --table "$DMLINEAR_RTTABLE" || \ + _dmsetup_remove $DMERROR_RTNAME + _dmsetup_create $DMERROR_RTNAME --table "$DMLINEAR_RTTABLE" || \ _fatal "failed to create dm linear rt device" fi if [ -n "$NON_ERROR_LOGDEV" ]; then - _dmsetup_remove error-logtest - _dmsetup_create error-logtest --table "$DMLINEAR_LOGTABLE" || \ + _dmsetup_remove $DMERROR_LOGNAME + _dmsetup_create $DMERROR_LOGNAME --table "$DMLINEAR_LOGTABLE" || \ _fatal "failed to create dm linear log device" fi } @@ -102,15 +106,15 @@ _dmerror_unmount() _dmerror_cleanup() { - test -n "$NON_ERROR_LOGDEV" && $DMSETUP_PROG resume error-logtest &>/dev/null - test -n "$NON_ERROR_RTDEV" && $DMSETUP_PROG resume error-rttest &>/dev/null - $DMSETUP_PROG resume error-test > /dev/null 2>&1 + test -n "$NON_ERROR_LOGDEV" && $DMSETUP_PROG resume $DMERROR_LOGNAME &>/dev/null + test -n "$NON_ERROR_RTDEV" && $DMSETUP_PROG resume $DMERROR_RTNAME &>/dev/null + $DMSETUP_PROG resume $DMERROR_NAME > /dev/null 2>&1 $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - test -n "$NON_ERROR_LOGDEV" && _dmsetup_remove error-logtest - test -n "$NON_ERROR_RTDEV" && _dmsetup_remove error-rttest - _dmsetup_remove error-test + test -n "$NON_ERROR_LOGDEV" && _dmsetup_remove $DMERROR_LOGNAME + test -n "$NON_ERROR_RTDEV" && _dmsetup_remove $DMERROR_RTNAME + _dmsetup_remove $DMERROR_NAME unset DMERROR_DEV DMLINEAR_TABLE DMERROR_TABLE @@ -145,45 +149,45 @@ _dmerror_load_error_table() # Suspend the scratch device before the log and realtime devices so # that the kernel can freeze and flush the filesystem if the caller # wanted a freeze. - $DMSETUP_PROG suspend $suspend_opt error-test + $DMSETUP_PROG suspend $suspend_opt $DMERROR_NAME [ $? -ne 0 ] && _fail "dmsetup suspend failed" if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt error-rttest + $DMSETUP_PROG suspend $suspend_opt $DMERROR_RTNAME [ $? -ne 0 ] && _fail "failed to suspend error-rttest" fi if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt error-logtest + $DMSETUP_PROG suspend $suspend_opt $DMERROR_LOGNAME [ $? -ne 0 ] && _fail "failed to suspend error-logtest" fi # Load new table - $DMSETUP_PROG load error-test --table "$DMERROR_TABLE" + $DMSETUP_PROG load $DMERROR_NAME --table "$DMERROR_TABLE" load_res=$? if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG load error-rttest --table "$DMERROR_RTTABLE" + $DMSETUP_PROG load $DMERROR_RTNAME --table "$DMERROR_RTTABLE" [ $? -ne 0 ] && _fail "failed to load error table into error-rttest" fi if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG load error-logtest --table "$DMERROR_LOGTABLE" + $DMSETUP_PROG load $DMERROR_LOGNAME --table "$DMERROR_LOGTABLE" [ $? -ne 0 ] && _fail "failed to load error table into error-logtest" fi # Resume devices in the opposite order that we suspended them. if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG resume error-logtest + $DMSETUP_PROG resume $DMERROR_LOGNAME [ $? -ne 0 ] && _fail "failed to resume error-logtest" fi if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG resume error-rttest + $DMSETUP_PROG resume $DMERROR_RTNAME [ $? -ne 0 ] && _fail "failed to resume error-rttest" fi - $DMSETUP_PROG resume error-test + $DMSETUP_PROG resume $DMERROR_NAME resume_res=$? [ $load_res -ne 0 ] && _fail "dmsetup failed to load error table" @@ -206,45 +210,45 @@ _dmerror_load_working_table() # Suspend the scratch device before the log and realtime devices so # that the kernel can freeze and flush the filesystem if the caller # wanted a freeze. - $DMSETUP_PROG suspend $suspend_opt error-test + $DMSETUP_PROG suspend $suspend_opt $DMERROR_NAME [ $? -ne 0 ] && _fail "dmsetup suspend failed" if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt error-rttest + $DMSETUP_PROG suspend $suspend_opt $DMERROR_RTNAME [ $? -ne 0 ] && _fail "failed to suspend error-rttest" fi if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt error-logtest + $DMSETUP_PROG suspend $suspend_opt $DMERROR_LOGNAME [ $? -ne 0 ] && _fail "failed to suspend error-logtest" fi # Load new table - $DMSETUP_PROG load error-test --table "$DMLINEAR_TABLE" + $DMSETUP_PROG load $DMERROR_NAME --table "$DMLINEAR_TABLE" load_res=$? if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG load error-rttest --table "$DMLINEAR_RTTABLE" + $DMSETUP_PROG load $DMERROR_RTNAME --table "$DMLINEAR_RTTABLE" [ $? -ne 0 ] && _fail "failed to load working table into error-rttest" fi if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG load error-logtest --table "$DMLINEAR_LOGTABLE" + $DMSETUP_PROG load $DMERROR_LOGNAME --table "$DMLINEAR_LOGTABLE" [ $? -ne 0 ] && _fail "failed to load working table into error-logtest" fi # Resume devices in the opposite order that we suspended them. if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG resume error-logtest + $DMSETUP_PROG resume $DMERROR_LOGNAME [ $? -ne 0 ] && _fail "failed to resume error-logtest" fi if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG resume error-rttest + $DMSETUP_PROG resume $DMERROR_RTNAME [ $? -ne 0 ] && _fail "failed to resume error-rttest" fi - $DMSETUP_PROG resume error-test + $DMSETUP_PROG resume $DMERROR_NAME resume_res=$? [ $load_res -ne 0 ] && _fail "dmsetup failed to load error table" diff --git a/src/dmerror b/src/dmerror index cde2b4284..96611b101 100755 --- a/src/dmerror +++ b/src/dmerror @@ -2,6 +2,10 @@ # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2017, Jeff Layton +# hackity hack hack - first arg is the test number, second arg is op. +# This is needed so that dmerror names the dm dev correctly. +seq=$1 + . ./common/config . ./common/dmerror @@ -10,7 +14,7 @@ if [ -z "$DMERROR_DEV" ]; then exit 1 fi -case $1 in +case $2 in load_error_table) _dmerror_load_error_table ;; diff --git a/tests/generic/441 b/tests/generic/441 index 9851ac219..6b48fc9ed 100755 --- a/tests/generic/441 +++ b/tests/generic/441 @@ -59,7 +59,7 @@ _require_fs_space $SCRATCH_MNT 65536 testfile=$SCRATCH_MNT/fsync-err-test echo "$here/src/fsync-err $sflag -d $here/src/dmerror $testfile" >> $seqres.full -$here/src/fsync-err $sflag -d $here/src/dmerror $testfile +$here/src/fsync-err $sflag -d "$here/src/dmerror $seq" $testfile # success, all done _dmerror_load_working_table From patchwork Wed Nov 27 04:51:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886543 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B29281AD7 for ; Wed, 27 Nov 2024 04:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683251; cv=none; b=T22dJglajpssmpFQl08trhtZ8lurGY0C//efFd2tNEVDGm7yXAvz8d3ZZ04D1aNL3mDfzWzYPTOQv9BlxXm1lrA+9cM5a7vCajU2B+wrq+n4/g1gVrDC6mUZVnDQTXePc8U9C65+vAYBDXKXsdZ+iJ+MWH3LKvSqfqmAaupSxd8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683251; c=relaxed/simple; bh=aYEaPH2/GPxJy5HfbWhE8f1jypLQ/lAIGmOi545jRaA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pjzGgw9kePSUwxqkpJ1loEg4HXc5VlcQHsdDfJW10nu+/GA2fPXVMF9wmf7saraqYOoSqJsQVbzMdLa/9rfzmq2sZkLAqbdcFwodO+pyZraxuF1R7RtW2z3u/2LGSCB5zXJAgxSCHLvCGANfMZwMIglSlqhaDC+lyrO4ZjorCAk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=xwiqWxph; arc=none smtp.client-ip=209.85.216.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="xwiqWxph" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2ea8b039ddcso5031366a91.0 for ; Tue, 26 Nov 2024 20:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683249; x=1733288049; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=XeZOo8eRbqCOh+Mr/WJaGp44XzlkeOAdFufROtEXAM0=; b=xwiqWxphkVRxvnwxsPqr/mL0I7Aw1fhD70ClbhBdLi0R0NmGQvQS1fM/3PnK3+ABIu txJpgG4yPS0JwipiVIE0GmEQLjqxCSNYazSRUit3vg3X3UHsGWaq2UyoMyDBgU1sOmQ3 /ddtgmYHK4C45m/U7NP7ANXxCZt5hEPG5LopId44vrFuV2YArRCF97+iXXeAZ7o5BXgs 8VF+0bee50D6+sly0cfVBNssJZWb5PB7j394LoB79fM6WFOjOYl0zsDJW2ZDgEkcm2ak x/ELuBc10o7uf9E8J4mqTZeetaW1hKZiV87U1tefs+4/vEmv1p0RF7xiVbIueww1XvzU 8iUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683249; x=1733288049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XeZOo8eRbqCOh+Mr/WJaGp44XzlkeOAdFufROtEXAM0=; b=QPDMFkYnrLudkk7fFcX4LdY8yz6fp/84tNSFzW3Yqsybpl5Esel/ZmOtXW+Rgt34rh VpxekAkdmqrYlJ0V3mhuf+xolzsKt1YUWGYQsZQuYIr1VRTU59m915w6XzaHYATx3umf FLX1aoLI5ByA/ANVKUOR4SKMmz75YHGXWpz5CNcvh0CDM0JwHsaEaqusgl3GJwsIlMvT IiThIXMDs7S7npd6vTfPZGjYCrfC8A+Pgvl4tU9y8QlGqOND+puVl3ITE/sHVo/0jcZU lgAZ1nAqHEZNpYuVMLrxChEQYMULpVv/jpnKrxkZt1HQ9Yl3l7zq5EBaOo9wVjowQHRc mEZw== X-Gm-Message-State: AOJu0YxRD62Nh0JqhiANdDQNURv54XaEjA86gkkwuGjSlN7gLq9Y6MCz ZtaBr2Xp9w2WsJBdvoB5wFw4sZFG5bUNbBX4qDFjEaG1Ld51rDDs+SFcxW3oL4yu7w0AUv/a1z+ i X-Gm-Gg: ASbGncv1tukTpAVfyZzlnp6LlFv/jG6J7Ky+BkJX7uzb1PFQ8mCG+lqmN+WXcMh+MuU P/muKirnaRjTUiQpwulaRn8eSIlyja2gpWkOqrH2pmcxJy9ncAGW3TopJfJQG5Z7tvIh+sCp/ra Thw6pypQb/wRwce2ChjNIXkZnYVocKsGcXAPKfSK+Pmohj5IUhVAbPB9UpqXZphyY3YcTpKCxgu rxS0ZoC2X8Nt2jk0f2YwoNaL6eEBbJ5W7miO/y0JwK34ubM3LkxZ6ruTDJRQSUmpOMqnbXMkAx7 unjto18HuGfvkjH5Ic4InX8A X-Google-Smtp-Source: AGHT+IGeoxkeF/7zq8x8mJdCpZOJwzug8hm3ywWmjopnYR1+shseKw0uBoZzoZx6XLpwAe9sc2j/Fw== X-Received: by 2002:a17:90b:1fcd:b0:2ea:3f34:f1a0 with SMTP id 98e67ed59e1d1-2ee095bfef5mr2463280a91.30.1732683248788; Tue, 26 Nov 2024 20:54:08 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee0fa9951csm490165a91.34.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:07 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3w-00000003ZUC-3jBF for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQdu-00ld for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 06/40] fstests: per-test dmhuge instances Date: Wed, 27 Nov 2024 15:51:36 +1100 Message-ID: <20241127045403.3665299-7-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner We can't run two tests that use dmhuge at the same time because the device name is the same. hence they interfere with each other. Give dmhuge devices their own per-test names to avoid this problem. Signed-off-by: Dave Chinner --- common/dmhugedisk | 19 +++++++++++-------- tests/generic/620 | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/common/dmhugedisk b/common/dmhugedisk index 502f02437..0757e1908 100644 --- a/common/dmhugedisk +++ b/common/dmhugedisk @@ -4,6 +4,9 @@ # # Routines for creating huge (fake) disks +export DMHUGE_TEST="huge-test.$seq" +export DMHUGE_TEST_ZERO="huge-test-zero.$seq" + _require_dmhugedisk() { _require_dm_target zero @@ -20,26 +23,26 @@ _dmhugedisk_init() chunk_size=512 fi - _dmsetup_remove huge-test - _dmsetup_remove huge-test-zero + _dmsetup_remove $DMHUGE_TEST + _dmsetup_remove $DMHUGE_TEST_ZERO local blk_dev_size=$1 - DMHUGEDISK_ZERO='/dev/mapper/huge-test-zero' - DMHUGEDISK_DEV='/dev/mapper/huge-test' + DMHUGEDISK_ZERO="/dev/mapper/$DMHUGE_TEST_ZERO" + DMHUGEDISK_DEV="/dev/mapper/$DMHUGE_TEST" DMHUGEDISK_ZERO_TABLE="0 $blk_dev_size zero" DMHUGEDISK_DEV_TABLE="0 $blk_dev_size snapshot $DMHUGEDISK_ZERO $SCRATCH_DEV N $chunk_size" - _dmsetup_create huge-test-zero --table "$DMHUGEDISK_ZERO_TABLE" || \ + _dmsetup_create $DMHUGE_TEST_ZERO --table "$DMHUGEDISK_ZERO_TABLE" || \ _fatal "failed to create dm huge zero device" - _dmsetup_create huge-test --table "$DMHUGEDISK_DEV_TABLE" || \ + _dmsetup_create $DMHUGE_TEST --table "$DMHUGEDISK_DEV_TABLE" || \ _fatal "failed to create dm huge device" } _dmhugedisk_cleanup() { $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - _dmsetup_remove huge-test - _dmsetup_remove huge-test-zero + _dmsetup_remove $DMHUGE_TEST + _dmsetup_remove $DMHUGE_TEST_ZERO } diff --git a/tests/generic/620 b/tests/generic/620 index bf97328d1..3f1ce45a5 100755 --- a/tests/generic/620 +++ b/tests/generic/620 @@ -47,6 +47,7 @@ testfile=$SCRATCH_MNT/testfile-$seq $XFS_IO_PROG -fc "pwrite -S 0xaa 0 1m" -c "fsync" $testfile | _filter_xfs_io +_dmhugedisk_cleanup # success, all done status=0 exit From patchwork Wed Nov 27 04:51:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886542 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17D33C8CE for ; Wed, 27 Nov 2024 04:54:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683250; cv=none; b=tLqcKyhAivuhUZzXMplD7Wn5JcuX056wfGY9jR5wDUS7UUhCq6/r6yw7CLU4EgoxVi97UoApR7elqFiFtc7980u54aviglZMgOBgKjfx93v7azAPGDvRy9TlN2CHGVN18HzoBNMffnmp8utqbqONubHUvIS8zVRD0XlAqrQvJC8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683250; c=relaxed/simple; bh=u0NqGrPHkPBh+ThIyO+QOucAWEOv1QaSJg+9iHHoqx4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WYKwPVMtxnO2wZ5eVLeNY0LlAC/EJvj7ZpRilsoCUMxnShLgMdNAjKjRFIv22VygiOdwqVuiya09Q+hSyYa0SWXMFmOS6bU9yysN7aqj1Ch+lISOzxCazg6Sur5Uj1mg9kTGlGeG9h8GB48KONY8ibVHz+loHVFdR4sn1NWM0Gc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=JbG8/czU; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="JbG8/czU" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-212348d391cso60994215ad.2 for ; Tue, 26 Nov 2024 20:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683248; x=1733288048; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=lhc88UwVJco40pqZl8KwTK/wY0FP5frjRRPeEfugaGk=; b=JbG8/czU3528VzRNnHGgqU+kIOXw4PXPKH4/Gz/W/1QPzSROan9X4+UlnaE030U4fS 5tJZ0d2756TkkXsNvbHF8teNLkfI8ZBi2eo/7NEpj9OZ7IbCFr7xRerE23TcGmt+19Qh VprH5DDSbuc2McZc3+MfnN/epGfmuw7mZ01/ypRZlV65ryUVxiRaL7guy8ua2LhpGpEl f52MpD7PnG3bSKdFWyOjMmhJbmRvb4D0KMUAHLwEPUENYywLgEXcOuvnOJ44+hpyHmZE tmZ1Bw4beysSToaI/6flmvH7k3GmU5xwdeFp0Ck2oupwGWEEzRh8jGgNJ2SbmTDQBoZ5 78Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683248; x=1733288048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lhc88UwVJco40pqZl8KwTK/wY0FP5frjRRPeEfugaGk=; b=X7Emb7YPQIXj7LqjAoU9rsCOR0+paxdcypP6/1/I/2w9E8OdgZXTJxX6koPD4vXE5B 6EfRFajCqXm6mBjNGkllhO/vc56+SO744Aex6leeq8f+M3/wiIgr8OSJjv+HRDLOZIoP adDYCB7FOOKIcBvslb1ubvy/C9vHhPb7jrHSKnX4ud5Iw0f1iKDruIJqF61srWASHIB1 w/Icm2mhJOEk1X3gf937s2kxHCQHorEIPgZic4bQ3FGOzo6s45yyXEfyp4eg+2rmwxf+ uND0UXRIJQmIAXf0fMzu680+WVHqXjfis08GNljTeSOZzODxjbvLrgtwF8lfRuCJA4mp wFRg== X-Gm-Message-State: AOJu0YweLoigyd7WSl4zbN9JikzSGfaJwBrmla+nGzMiMMEGJ2jO3g89 JHmH5oAhZKNOI7iO5J7f1+wTnHah9AafaL30fKTXv3i4paIcVbmORPxaJASzSj3128VgjFL7AYl S X-Gm-Gg: ASbGncs9KAyYiXvCLXyv8ckkFMX+hvrilJRTvT/JGoHhJufL/Xk3EU/S+iUy4eD0UHS YTwkV6a8ZHp+XqquM0qmcawJXjhCZCLesb7vpAx62DjyL5Oa8IcvY881y/wkZ3w4dVIEJ1WdVhm mj5UyL6th2NEwSkB86tRM86XvlMRBIvhZ8w3gsuDAImnrF/8s++2xeZnezwaXytKtndUz7+fxcz bKygPnFakBLgwt1U34y/LWbTN38N9R/+GvbZYSHR8FGvLAPyrX+7r07bMg3XaIfm82m5PQ6M3/V GggoDzzgluIews86nYMGS7cN X-Google-Smtp-Source: AGHT+IHr+iG8VSF6Eabj3RGdNyJ0qE6ZeiC5x4JFP3IIwPQgWLBtKyCg9BAWxOeXYxhfe0uqRbbFcg== X-Received: by 2002:a17:902:d48c:b0:20c:5404:ed69 with SMTP id d9443c01a7336-21501a43fc5mr22428335ad.31.1732683248405; Tue, 26 Nov 2024 20:54:08 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dbfeb4esm93849625ad.164.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:07 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3w-00000003ZUG-3sbo for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQdz-0ArY for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 07/40] fstests: per-test dmthin instances Date: Wed, 27 Nov 2024 15:51:37 +1100 Message-ID: <20241127045403.3665299-8-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner We can't run two tests that use dmthin at the same time because the device name is the same. hence they interfere with each other. Give dmthin devices their own per-test names to avoid this problem. Signed-off-by: Dave Chinner --- common/dmthin | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/dmthin b/common/dmthin index 7107d5080..f2c00f5a7 100644 --- a/common/dmthin +++ b/common/dmthin @@ -9,16 +9,16 @@ # from a single scratch device # Backing data dev -DMTHIN_DATA_NAME="thin-data" +DMTHIN_DATA_NAME="thin-data.$seq" DMTHIN_DATA_DEV="/dev/mapper/$DMTHIN_DATA_NAME" # Backing metadata dev -DMTHIN_META_NAME="thin-meta" +DMTHIN_META_NAME="thin-meta.$seq" DMTHIN_META_DEV="/dev/mapper/$DMTHIN_META_NAME" # Backing pool dev (combination of above) -DMTHIN_POOL_NAME="thin-provision-pool" +DMTHIN_POOL_NAME="thin-provision-pool.$seq" DMTHIN_POOL_DEV="/dev/mapper/$DMTHIN_POOL_NAME" # Thin volume -DMTHIN_VOL_NAME="thin-vol" +DMTHIN_VOL_NAME="thin-vol.$seq" DMTHIN_VOL_DEV="/dev/mapper/$DMTHIN_VOL_NAME" _dmthin_cleanup() From patchwork Wed Nov 27 04:51:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886549 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E36E113CFB8 for ; Wed, 27 Nov 2024 04:54:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683253; cv=none; b=Ra3A8hG7pn2qrmKnhq8fLB8+tJUeZ+RSw50aMdBRbkto8+ZfUk5N8L6Qz46a5x1kMfK6p6UejYckw+kVALf9RA3kBouUIhuLNMfl4M8liSMfYBWCMxI9jFX+nD38FWWJg/4OsquRPd4acm+KibRZ44BrUajLlbjiA6k9W6rJf00= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683253; c=relaxed/simple; bh=0vTE6IWNZia74SrWsrPk1ISh7bGgWmOszPA3IJNmm0g=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J84welPmnvzvpVQ/RmpFnqbUOCTviCvAu0xpvuH6p0nEThHZFA/dVx7Qp/DQ2/9QUp0tZtPT7U1VGs8LHM/D2Jhp3WBNgHOQsxSbU029oMXgAJQexU6nbpKawvMQdYL7vcUtSp6umEVLcq4phYe71jenEZ1afJSjAIIZ6JkNIfc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=KN2xD5gB; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="KN2xD5gB" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-211fcadd960so43155905ad.2 for ; Tue, 26 Nov 2024 20:54:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683251; x=1733288051; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=uwAK2eRmz4IdUCzekThmIWw4rKmIlS09JeZMdVd3kWU=; b=KN2xD5gB/3vBn82bKMxGlIk5Op3HyzDDqn0WLp+9ykZkG2o0p4YLhPH5QJ7b35puDX +kNuqun99Av5ZwRlms+tVgXqB6AWGVc4RCScEMBRnxGbKKhwWCNT6r+GMjr5vCFFMx9g aRAZZ4kiPqkyiBlaimvzININ3uncAxfsH35yGPbZ5TRANwPjZ3qTyER73sgce7ZfyuO4 m3SbMy5D6Ley8u7k3tiBeTxXnjnE++uej9nXvu/1xTFvquyeJhsYiufia6Z1cSDZtbB8 l8/3sXcjJdSmsuRaIGH2su+XLm7xTWIOkPNL0A2Vg1lVvjDaCTjkRNr/GHDR//uL99jW uwlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683251; x=1733288051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uwAK2eRmz4IdUCzekThmIWw4rKmIlS09JeZMdVd3kWU=; b=PdwPiDE12sftmVLqeQIxbxzOB1dGsJGd3nFPeJlSWMWVVZjoh4L/VWv2WqZ92y+0tw oxd/BybL0T/RsKVvjeKnBBN+El9ef7iWKXOWmkx3EwDSZWHHEvIjc/xj8G03SnXyzfmj AuXkeAwkl1xOuiO620Vx8CVPIqV6nswge7qm9FHgKScuUxL9JXUJp7PTsdoXxLr0ux7c kHj7LopkusNlkeInLbSD3Og49nS19aBIMVpKC+313VpKnlPlxa1DdC/QvstxNMBpe/Mz 3XZlZmVYCENecEeQMF88fVzJHxowZGkdjcrq/48cg7aTUSj2z0beQgxm/3dQtplpgZT6 M3XA== X-Gm-Message-State: AOJu0YwtcV++hx0eBLYexTAF1uiI1B3vtpwYUkS/+HFTW1XgfL6lE4R4 9FCJtrpqM31xvbFWlGcU7an4F4//zGd4eK9XS9J6ejIzdtekVKBb1p5VPcK4b9rgOPKSvvUPPl4 0 X-Gm-Gg: ASbGnctj0fTlxdDhEmgXMLsCv6GyAO1jBandoi/2dYaLH7iotpW//lxlmZEg2KjaSoY vytNTOVJCqqQGSS7//Ubu47oGhKhIoUyw9MJoenxSJ5g2PNhlZzo18vxlfzMBxtYGL8waDD1OaU ZMdtoZsTCox00v7RyRofA/3lsAu0lq2kMrEIESHOM0PXq3L3PsjDtbIBEv6JPSYxGhswYEUmYol r9jA6Zgni8DJVgyVvipgyyuWvAt2jHnWiMypz3Jl8u/JCiUonVvCc807ppSfNOKk4rrFjewYqfh 8/rXnOJOJFggggZ1OgYRofzq X-Google-Smtp-Source: AGHT+IFUKxEz5k5cb1KHi4MkMsUdM0Qh4hao8ZmDV2fYcXKV9frIb52rxBonPWBA9+Llo/QeGjya8w== X-Received: by 2002:a05:6a20:a10f:b0:1e0:cc21:19a2 with SMTP id adf61e73a8af0-1e0e0aaf55bmr2973800637.1.1732683251214; Tue, 26 Nov 2024 20:54:11 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fbcbfc0886sm8321827a12.2.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:09 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3w-00000003ZUL-41Fe for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQe4-0MCX for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 08/40] fstests: per-test dmdust instances Date: Wed, 27 Nov 2024 15:51:38 +1100 Message-ID: <20241127045403.3665299-9-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner We can't run two tests that use dmdust at the same time because the device name is the same. hence they interfere with each other. Give dmdust devices their own per-test names to avoid this problem. Signed-off-by: Dave Chinner --- common/dmdust | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/dmdust b/common/dmdust index 56fcc0e0f..37bb865c8 100644 --- a/common/dmdust +++ b/common/dmdust @@ -4,12 +4,14 @@ # # common functions for setting up and tearing down a dmdust device +export DUST_NAME="dust-test.$seq" + _init_dust() { local DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` - DUST_DEV=/dev/mapper/dust-test + DUST_DEV=/dev/mapper/$DUST_NAME DUST_TABLE="0 $DEV_SIZE dust $SCRATCH_DEV 0 512" - _dmsetup_create dust-test --table "$DUST_TABLE" || \ + _dmsetup_create $DUST_NAME --table "$DUST_TABLE" || \ _fatal "failed to create dust device" } @@ -29,7 +31,7 @@ _cleanup_dust() { # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang - $DMSETUP_PROG resume dust-test > /dev/null 2>&1 + $DMSETUP_PROG resume $DUST_NAME > /dev/null 2>&1 $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - _dmsetup_remove dust-test + _dmsetup_remove $DUST_NAME } From patchwork Wed Nov 27 04:51:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886570 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFF2F4689 for ; Wed, 27 Nov 2024 04:59:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683581; cv=none; b=VT0NTOy9wY0kNv9SXMbA7/SqmBZ1+QfExdKzV1RLj6b1KgklpqoqG+oFFJ2fRZ6KidRqmHinl3vNZ5NzWr8C/FcZbqrDbrj/KmAfJOQ7/4cTs/QvuF/rc9hiIB55K9nPRgw0Ukz+c39JFk8rKyzpRz8OFXdHiWBLz7hcCts80fc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683581; c=relaxed/simple; bh=OvqZjkLmidtiPpSC3NXJZPas+XM2soqZGPX6TekKEhY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HneA/4y7EsB/CEelKl/jdZcty43zG6WNpcb/zjdkqXT3otPZD97S6Nu7mnizU/cSHwXKcgIDmoyoqj15C6w4l6K4DUAeIh9yqjhNGiBG7fWzx9QuTaiKdc4cciGTVQxI9KW5Hgp9z8QkyFPZ2SZzgrzqgGyT26VVzExY86oj20Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=NdsplSDy; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="NdsplSDy" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-21210fe8775so3558845ad.1 for ; Tue, 26 Nov 2024 20:59:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683579; x=1733288379; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=uLyvRmpA/T9GK7gzdKLhJ6NSQ3rODHP4ylzcE+r6rVY=; b=NdsplSDyjO1/rmZBJoQzCPnDbP4AdLxgAVkI0DONw0/CLNybOKVWxFpT0yXPPUzSO4 8ZUr4J1tvaE57mUOu+cZPbQSjqGXj3VX2OEoBCZtkOi5k5PGdNlOa0ACOlAstdAMcQgF 9jq0nJtuT6NlVlj0Fhcn+8WbXHiPzYlzJhDG6JLoF1WEwOjYQ6oBAJ1VK1wbuvtE/M9w GPVzA3Azx9AOEiFyNjXT7ogt8GQP3UI5MLB+q8k0ksAXK1zcTwzwyMCntcg5bTLpwbo8 t++VXjjBwTmIILYZbn6TquXvlwBMQ2+gF6Uq+0ZOjTPjaZDvyqAjEK85+in4BXYFzBnU I58w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683579; x=1733288379; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uLyvRmpA/T9GK7gzdKLhJ6NSQ3rODHP4ylzcE+r6rVY=; b=OyKlKLVpyKy4oZsJOGrq4bsL+r9FdPOvcfL2wEN2NyUHyX69VgQaAPRMkEntJtD8fX RKOCSLpKfLf5h7hfNorCkHmNsk/ESW7xaEBcNgIiOzCsx+kuum5XkvvOo4NmjD8DX+fV bzkrjhOt3lWP7AqSFPFph8JLrp0KT3WnhxYudfKxElHCJDQXkKGvjM9BEjHDBjUFwfYJ FLV+XHTmKEJ3hSqVFToRpYmjzVAosbp4CDQpKcHDY5LtHg8Q28DjtPOxx6ppCLSI8aEy Jf7HUFMuSsyqPK1BT4e6Qpf7Jp45jrFsbJw6eE7pX4g7rMsn7AZtiZnCt0AXLqGQRVcd 2kyA== X-Gm-Message-State: AOJu0Yyk/5ww7eCUAs2vaJ59jUDb9PKZHUpUkUeB6cjeWhtqiQqTljO2 lybtfoBAswdDWmBOD3fCglGC+49KVHtwpoOJ4q2/GRmtMgctgVpPpf7SprRx5hXeay4yvqRkqPF C X-Gm-Gg: ASbGnctZGjWJYuP8GrqKYgLX9fOxg0o7fYBHyMsbwSAbVCbXeZZKwm3btIxHv71GKhy YUzqoOJJn+R26Rtko5S5QrKhsPNu2k+IR8nvJ9ObyTa+We3YNyt7JC672BVoIooWciwQPlSVOuy KKdGGLjqv8qxiabT2y+HI8nMZpCpUpOJjcRicNLK4GgRO4nAemKCxFdzKV/N9UED2yrBVJEqjqd 1dYMeVnm1vo3M7g0FEnKfYlhMZQkf5+MM71y8Lck5IL1jCFBqrMia1smea2mMz6OPlndnyLnAjQ DbKBAEsLLKk/NA== X-Google-Smtp-Source: AGHT+IG/yq2VIBM2mbfk4EW9oRuDg8P0JCv2biZTycv1L6SwqH7jlxqjod7SFiRXjErIzswEiCbQPQ== X-Received: by 2002:a17:902:fc85:b0:212:38d7:78ea with SMTP id d9443c01a7336-21500fc4fe7mr30388405ad.25.1732683579247; Tue, 26 Nov 2024 20:59:39 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dc13239sm93367515ad.177.2024.11.26.20.59.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:38 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZUP-02zd for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQe8-0Xk8 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 09/40] fstests: per-test dmdelay instances Date: Wed, 27 Nov 2024 15:51:39 +1100 Message-ID: <20241127045403.3665299-10-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner We can't run two tests that use dmdelay at the same time because the device name is the same. hence they interfere with each other. Give dmdelay devices their own per-test names to avoid this problem. Signed-off-by: Dave Chinner --- common/dmdelay | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/common/dmdelay b/common/dmdelay index 66cac1a70..1c4fca6e9 100644 --- a/common/dmdelay +++ b/common/dmdelay @@ -7,13 +7,15 @@ DELAY_NONE=0 DELAY_READ=1 +export DELAY_NAME="delay-test.$seq" + _init_delay() { local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` - DELAY_DEV=/dev/mapper/delay-test + DELAY_DEV=/dev/mapper/$DELAY_NAME DELAY_TABLE="0 $BLK_DEV_SIZE delay $SCRATCH_DEV 0 0" DELAY_TABLE_RDELAY="0 $BLK_DEV_SIZE delay $SCRATCH_DEV 0 10000 $SCRATCH_DEV 0 0" - _dmsetup_create delay-test --table "$DELAY_TABLE" || \ + _dmsetup_create $DELAY_NAME --table "$DELAY_TABLE" || \ _fatal "failed to create delay device" } @@ -33,9 +35,9 @@ _cleanup_delay() { # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang - $DMSETUP_PROG resume delay-test > /dev/null 2>&1 + $DMSETUP_PROG resume $DELAY_NAME > /dev/null 2>&1 $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - _dmsetup_remove delay-test + _dmsetup_remove $DELAY_NAME } # _load_delay_table [lockfs] @@ -52,15 +54,15 @@ _load_delay_table() # run a suspend/resume cycle to avoid excessive resume delays once a # delay is introduced below - $DMSETUP_PROG suspend $suspend_opt delay-test - $DMSETUP_PROG resume $suspend_opt delay-test + $DMSETUP_PROG suspend $suspend_opt $DELAY_NAME + $DMSETUP_PROG resume $suspend_opt $DELAY_NAME - $DMSETUP_PROG suspend $suspend_opt delay-test + $DMSETUP_PROG suspend $suspend_opt $DELAY_NAME [ $? -ne 0 ] && _fatal "failed to suspend delay-test" - $DMSETUP_PROG load delay-test --table "$table" + $DMSETUP_PROG load $DELAY_NAME --table "$table" [ $? -ne 0 ] && _fatal "failed to load table into delay-test" - $DMSETUP_PROG resume delay-test + $DMSETUP_PROG resume $DELAY_NAME [ $? -ne 0 ] && _fatal "failed to resume delay-test" } From patchwork Wed Nov 27 04:51:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886548 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D79813C9D9 for ; Wed, 27 Nov 2024 04:54:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683252; cv=none; b=AJHJI0UQhXE1fIQ/1g741dvNR9aOCGdILwEgVSQqcOT6zlRLndnNg8lNBvxnAlaZaiIRVQM5zMbCdnr8f7GqxM6N2l+Ch8vLTdxpmEz5CgvVsc1Y4OXeOO+mVz9OR6J/mCHlUKDuaT4kppr1lgMYslpTFgoFY0dfeKvawVvjIMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683252; c=relaxed/simple; bh=KTI25EQFWJbOCEvtnqjR61YxGCSAt5F7+1DCcN5IaH8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G8CHMtw48DCG6lWP8Y8LqI3Rz5txRHGdunlrPP1Tibr9t3D98yrH4Pgzgsa+TE1t/udXoS0D7yypHKt0Aes54yyHeBTocGlXf6FLNjkNL6rkzdvgw2Z/959XBCHJ94lDdnITYDd98ubY/ObtWEdaeuNjnIFyfLlrQ6z7BU6KykE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=t2m2hSyf; arc=none smtp.client-ip=209.85.210.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="t2m2hSyf" Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-71d4e043dd9so1442711a34.1 for ; Tue, 26 Nov 2024 20:54:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683250; x=1733288050; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LRi8p2vG65siHZi4g0d6yn8UFaizrYqtdSaScXwCU00=; b=t2m2hSyf5oX4DuIC4uoEUA2H2PlqJnofR54mUYQLGziHqiTzshHkaoW2k8h1Ffzj68 9jzsVyYTblcrex/9ooJIDIJCMHFY2NGK+i5o1EmatzN0jRJPpqyZptp8FeUlp+GTEcu1 T4BX1R5fqqW7wqmuLmlDSHc1s+UuvKUauAzlctXFrrnFHvFtl58bByzGcyCjTAJx9DfU 3BrUbuNtC2KBmlNVSfzI0IePz9tW1LimUekz1bB6YrENLN85N4a2G59/tXJ03xm4yD3e Zs3UdrDVqOU00otvjWKGT6wspwXuOuN9CiVM0vJZPsd/7EuX/OGsjX5QG6pxER1UV5uU XGaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683250; x=1733288050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LRi8p2vG65siHZi4g0d6yn8UFaizrYqtdSaScXwCU00=; b=YZOw3U4Y3SSN4EH3H7vRmTWkTbJAHGJ79OvYjYfrlVTzs5k/jnaVOgDSy/duJZa3tx b2y8px/pcnus0dSFabVAVfliZXc+kIcjJRt9nBcYe8SVjnzAkOMeHkGGeHcJZTtl6mFl 9mz39pNGkypEbB2DdIQQUkeG1cE2onIAQL3g4PhYV3aD6etf7CP3BegcrQ2D3QwNi6/Q hIkFQBefL8qQcmngkgdLZSaLxGOYDHDk3FZpEqxevjxA8YYUzkizRozkRW03R62fbC+4 KwGhKMPL2xJLOv4mdIP+w8jOgSssPogPxtBQZPGQJg2fOCuCLvxRjfHVkeIOQR/4AHoS RyMw== X-Gm-Message-State: AOJu0YzktxUYLOoAUMnLmhGsU7ioOTnzTHAlhBQvFNpJcvdLzqV/eyJg X3GRiSTk5tFnUa9d/W3/HFc1O3Sb8/yzjf2mik5LpYVolvzD0UjUtM4Hu3lvy+jhARp0X+91D9t F X-Gm-Gg: ASbGncs2XawFa/f8LF0C7HOz0IBB++BdDz8BY+XgMbSk8YHT2rRWK3Embp2D7LKo4oQ 0c0wtELVps7VFyk2bHo1FnBMTHMOobqmNbdDJzYb35lkEHBFUr6R8MxcbGDUGAk5NMwK9GAG7g5 b6XNoLqXAJ1f3JXhZgSln+a0E/I7d3xvSkl5nqV++pvq/lxxEyKvgygJw6chwU0WtkH9SZ79iXO UniW7Q8JcDtshQKImJwMkS7hC3L3sw95LDUBvkcvLxo3G2uZ/3nTxXsP9SjFdI+M7eiWr9pydgC +JkeMI6dy7tWPqFLNPy/S/Kb X-Google-Smtp-Source: AGHT+IHhD9ISIaquTIAqsav7Fd8jdTNsmdsLbq+UjAadfDWoX2SFPG5njJGcAqE2wEggp8CTXWnusA== X-Received: by 2002:a05:6830:4113:b0:718:1163:ef8f with SMTP id 46e09a7af769-71d65c7e396mr1462173a34.2.1732683250425; Tue, 26 Nov 2024 20:54:10 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fbcc3e09acsm8171837a12.67.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:09 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZUS-0GJQ for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQeE-0kBl for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 10/40] fstests: fix DM device creation/removal vs udev races Date: Wed, 27 Nov 2024 15:51:40 +1100 Message-ID: <20241127045403.3665299-11-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner When there is load on the system, newly created DM devices don't seem to be created consistently. When a new device is created, it is supposed to be created as /dev/dm-X, and then a udev rule creates the symlink from /dev/mapper/ to /dev/dm-X. Unfortunately, a lot of the tests that use dynamically created dm devices (dmerror, dmflakey) are not being created with this device node structure. This is resulting in getting the wrong short device name for the block device and hence we can't find the filesystem sysfs attribute directory for the filesystem on that block device. For example, with added debug to check what device name was being passed around and resolved: eneric/489 - output mismatch (see /mnt/xfs/runner-10/results/xfs/generic/489.out.bad) --- tests/generic/489.out 2022-12-21 15:53:25.503043574 +1100 +++ /mnt/xfs/runner-10/results/xfs/generic/489.out.bad 2024-10-24 10:27:29.767196340 +1100 @@ -1,4 +1,10 @@ QA output created by 489 +./common/rc: line 4955: /sys/fs/xfs/flakey-test.489/error/fail_at_unmount: No such file or directory +dev: /dev/mapper/flakey-test.489 +resolved dev: /dev/mapper/flakey-test.489 +brw-rw----. 1 root disk 251, 5 Oct 24 10:27 /dev/mapper/flakey-test.489 +./common/rc: line 4955: /sys/fs/xfs/flakey-test.489/error/metadata/EIO/max_retries: No such file or directory +./common/rc: line 4955: /sys/fs/xfs/flakey-test.489/error/metadata/EIO/retry_timeout_seconds: No such file or directory ... (Run 'diff -u /home/dave/src/xfstests-dev/tests/generic/489.out /mnt/xfs/runner-10/results/xfs/generic/489.out.bad' to see the entire diff) Here we see that the block device node is actually at /dev/mapper/flakey-test.489, not a link to a /dev/dm-X device node. This implies that the udev rule to create the /dev/dm-X node and the symlink to it at /dev/mapper/flakey-test.489 has not run, and something else created the device node. That looks like a bug in _dmsetup_create(). It creates the new DM device, then runs 'dmsetup mknodes', then waits for udev to settle. This means the mknodes command - which makes sure the dm device nodes exist - is racing with udev to create the device nodes. They don't use the same rules to create nodes, so we end up with this broken situation. 'dmsetup mknodes' is considered legacy functionality, intended for systems that have no udev capability. For systems that have udev enabled (i.e. all modern distros), mknodes should not be run because it creates a different device node structure to what udev creates and can race with udev as we see here. Fix it by removing the 'dmsetup mknodes' as it is unnecessary to create the correct device node layout the rest of the system is expecting to see. Additionally,_dmsetup_remove() calls 'dmsetup mknodes' and that can also race with udev and cause issues. Hence we need to remove that call from the remove operation as well. Further, 'dmsetup remove' is also subject to races with udev which results in device remove failing. This problem is documented in the dmsetup man page and suggests the use of the "--retry" option. This means dmsetup will retry several times over a few seconds before failing the removal. This reduces the remove failure rate substantially, but it can still occasionally fail when the system is under heavy load and udev processing is very slow. This is fixable, but requires fstests udev infrastructure changes as it requires udevadm functionality that is relatively new. Hence that will be done as a separate fix. Signed-off-by: Dave Chinner --- common/rc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/rc b/common/rc index 391370fd5..a601e2c80 100644 --- a/common/rc +++ b/common/rc @@ -5162,8 +5162,8 @@ _require_label_get_max() _dmsetup_remove() { $UDEV_SETTLE_PROG >/dev/null 2>&1 - $DMSETUP_PROG remove "$@" >>$seqres.full 2>&1 - $DMSETUP_PROG mknodes >/dev/null 2>&1 + $DMSETUP_PROG remove --retry "$@" >>$seqres.full 2>&1 + $UDEV_SETTLE_PROG >/dev/null 2>&1 } _dmsetup_create() @@ -5174,7 +5174,6 @@ _dmsetup_create() # device open won't also fail. $UDEV_SETTLE_PROG >/dev/null 2>&1 $DMSETUP_PROG create "$@" >>$seqres.full 2>&1 || return 1 - $DMSETUP_PROG mknodes >/dev/null 2>&1 $UDEV_SETTLE_PROG >/dev/null 2>&1 } From patchwork Wed Nov 27 04:51:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886556 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E2A413BC35 for ; Wed, 27 Nov 2024 04:54:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683260; cv=none; b=TA95G2+5Jm43oCOO22F0nkU689+QfT+fMsVKWuAGCD6VZsZKy9Si23FlRXbn75epwWpbKm0QYEaHhuVam2ImGblpff7kPzTMiuJHvU8TOvCGOiS0d5wOqGqp9aRTtAsawOzPXoZK0gs3u0CoJPyyZ5t9MtBHO3kDr/r/8xxSMCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683260; c=relaxed/simple; bh=1QG3SVpu58zAKVQ0hH5HKMHRFBBYiIR4Gyictzlvj38=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BpYxOhC5Cai/aM5dzi387QSXe4t98pYaKfbP5DBKafRzznCbVGBqp522wdyoLBQfBTru5s3jpTxO0QPmkfGZnTWz1MEhxGOD4hrkQ9qIiIBHviSGwPChYnL4asGk5zahGYgeE/+qevh44+a6pDhmIqxNDHavuHak+3OYbhzfgns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=2LgiXNfZ; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="2LgiXNfZ" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-724f42c1c38so3388958b3a.1 for ; Tue, 26 Nov 2024 20:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683255; x=1733288055; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=x7m4PnThamll/bllhIx+eaN/eVvtz00xLHe4m6xNTpg=; b=2LgiXNfZ0Szh+yn1zJX0pWOmZDr67ZgkyNMs1yx65R+s534+i4KuRBMGm1wxJislmw JO3/2DJeaX5fwCaMe1lrh3kIzBQ9rzsVSsAQvysO0seM71IiNVXDkoFwymKKfFHpE+5Y QdmpcSg1yhEd/WGzp9d7VRH1RcnrpQx03giOeYG25RPUdbAZmWYikts1t74xCq4BSWyW zs3X9OknIvuhSzkWipnRo0g7xeiyTFhjeCQuNdhF/tN37gAjWrpUV09eltaq5lRjiGpr n/G5KysfCeQ2ReAG4hOXZZkU2XGzUjs4YSC6VDxL8bwL30PZnhruBwyBkENTRUBXv7ve 4uCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683255; x=1733288055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x7m4PnThamll/bllhIx+eaN/eVvtz00xLHe4m6xNTpg=; b=nG0PbwhpIZgFnBHO9UF7O/zXTEQf2/GdBnL38g+HT1JDi/Bu54ytC2r8VVQgNUQfLn PU1lqG1AR2mKoVrs8w9iq7rbGpK5m/ELCkNcIUM01ToMKPNt/3D8PgzM03RyetcJ9mV/ ey2MOh2cebybwTPZWqOoKETP0aTkDYqTOjbDAgis4jEWoT/LJH/1YmeXfRooA4u7YDWK Y9KT+xyWu8Fd5DJ82gSuDmjqGnGf4zKvi9Tvhq7AfFkLPeB+oUApcAeSzXxw2SVCg3DV RQt4DL+3GBMSNy1Dr7/zBO/fyoNrcA4TQV1XuU/MDoq510LuMMXs1vwPdMJhbf0qszC0 NoHQ== X-Gm-Message-State: AOJu0Ywpk12eFWMysEOkLHCY9PVnyo01NylufHiPSik/ynMhRMWaKVmS M4supMpHx6ExmvlJQsXAgRBaK+VAEEOF1aVwaklXtG43XBdXqALWTgNf/qKBbGfYf4cadvH4V/M Z X-Gm-Gg: ASbGncu7+yQalB+ph6L70KzgZwVtqMKKbqw1sfCKwnqKkBdOuvtDSmVXvhrhr/oY2+B 78kk++uHM2V1KFQmwY4JMiqK9bu12wd7zE58tae2Zlbo+lLUmFKxJBScF82SWUHnmxGYZdmqw7y oaXwI6Vy+Vkk1oAo5eqTI9LZueqpze2yccaeTyXGTqFnit8SAXx7ewp1RmT0yu0WIBMCvVieJje /3kEu2EZlVVMdT2XgMriGzp1+seWbks5c9ybDJF5FmOs5REHHOQRTv36cUFK9Xg5uLWLRxI0S+4 XboNtyJPM+wykCCU8iMfuL0R X-Google-Smtp-Source: AGHT+IG+/woLtbJI77y0BJ75S0owj0W0yzVc/Ag3JNbN4sX3vYHEaaln9sqhtHbBADGhvrWnoBkBJg== X-Received: by 2002:a05:6a21:99a5:b0:1e0:df27:10b8 with SMTP id adf61e73a8af0-1e0e0b52839mr3347220637.31.1732683253842; Tue, 26 Nov 2024 20:54:13 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724de48f13fsm9351365b3a.84.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:10 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZUX-0Sde for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQeJ-0vc7 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 11/40] fstests: use syncfs rather than sync Date: Wed, 27 Nov 2024 15:51:41 +1100 Message-ID: <20241127045403.3665299-12-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner sync(1) is a system wide sync and is implemented by iterating all the superblocks in the system. In most cases, fstests require just the filesystem under test to be synced - we require syncfs(2) semantics but what we use is sync(2) semantics. The result of this is that when running many concurrent fstests at the same time, we can have *hundreds* of concurrent sync operations in progress (thanks fsstress!) and this causes excessive interference with other tests that are running on other filesystems. For example, some tests try to specifically control extent layout via specific write and fsync patterns. All these global syncs perturb them and cause them to spuriously fail. A random snapshot of running concurrent tests shows just how many tests are explicitly blocked in sync(1): check-parallel───check───077───077─┬─cut │ ├─du │ └─tail ├─check-parallel───check───311───xfs_scrub───{xfs_scrub} ├─check-parallel───check───531───128*[t_open_tmpfiles] ├─check-parallel───check───227 ├─check-parallel───check───388 ├─check-parallel───check───070───fsstress───fsstress───{fsstress+ ├─check-parallel───check───232───fsstress───7*[fsstress───{fsstr+ ├─check-parallel───check───648───sleep ├─check-parallel───check───409───sync ├─check-parallel───check───683───sync ├─check-parallel───check───013─┬─013───sleep │ └─fsstress───2*[fsstress───{fsstr+ ├─check-parallel───check───684───sync ├─check-parallel───check───673───sync ├─check-parallel───check───118───dd ├─check-parallel───check───467───open_by_handle ├─check-parallel───check─┬─622 │ └─check ├─check-parallel───check───685───sync ├─check-parallel───check───049───fsstress───fsstress───{fsstress+ ├─check-parallel───check───599 ├─check-parallel───check───426───open_by_handle ├─check-parallel───check───057───umount ├─check-parallel───check───390───fsstress─┬─18*[fsstress───{fsst+ │ └─fsstress ├─check-parallel───check───158───fsstress───fsstress───{fsstress+ ├─check-parallel───check───017 ├─check-parallel───check───032───fsstress───fsstress ├─check-parallel───check───076 ├─check-parallel───check───477───open_by_handle ├─check-parallel───check───170───2*[170───170] ├─check-parallel───check───112 ├─check-parallel───check───686───sync ├─4*[check-parallel───check───check───xfs_scrub───{xfs_scrub}] ├─check-parallel───check───387───xfs_io───{xfs_io} ├─check-parallel───check───615───615 ├─check-parallel───check─┬─051 │ └─check───xfs_repair ├─check-parallel───check───049 ├─check-parallel───check───247 ├─check-parallel───check───674───sync ├─check-parallel───check───040 ├─check-parallel───check───560───fsstress───fsstress───{fsstress+ ├─check-parallel───check───030─┬─030─┬─030───xfs_repair │ │ └─030───perl │ ├─sed │ └─uniq ├─check-parallel───check───055───055 ├─2*[check-parallel───check───check] ├─check-parallel───check───042 ├─check-parallel───check───204 ├─check-parallel───check───271─┬─271───sed │ └─md5sum ├─check-parallel───check───091─┬─fsx │ └─tee ├─check-parallel───check───063───sleep ├─check-parallel───check───026 ├─check-parallel───check───459───lvm ├─check-parallel───check───495 ├─check-parallel───check───141───fsstress───4*[fsstress] ├─check-parallel───check───011─┬─fsstress─┬─fsstress───{fsstress+ │ │ └─fsstress │ └─sleep ├─check-parallel───check───328───sync ├─check-parallel───check───507───507 ├─check-parallel───check ├─check-parallel───check───687───sync ├─check-parallel───check───109───mkfs.xfs ├─check-parallel───check───324 ├─check-parallel───check───114───aio-dio-eof-rac └─check-parallel───check───503───xfs_scrub───2*[{xfs_scrub}] There are ~10 sync(1) calls blocked and at least half of the 50-odd fsstress processes currently running are also going to be stuck in sync(2) calls. They are stuck because the superblock iteration has to wait for mount, unmount, freeze, thaw and any other operation that locks a superblock exclusively. When running dozens of tests concurrently, there can be tens of superblocks that are locked exclusively for every second for significant lengths of time. Hence the use of sync has impact on both performance and test behaviour and we need to minimise the amount of sync(1) and sync(2) usage as much as possible. Introduce _test_sync() and _scratch_sync() so we can implement a syncfs mechanism with a fallback to sync(1) if it is not supported without dirtying all the test code unnecessarily. Then convert fsstress to use syncfs(2) in preference to sync(2). This commit changes all the generic and XFS tests to use the new sync functions, other filesystem specific tests will eventually need to be converted to avoid similar problems. Signed-off-by: Dave Chinner --- common/encrypt | 2 +- common/log | 2 +- common/quota | 2 +- common/rc | 24 ++++++++++++++++++++++++ common/repair | 2 +- common/report | 2 +- common/verity | 2 +- common/xfs | 2 +- ltp/fsstress.c | 12 ++++++++++++ tests/generic/015 | 2 +- tests/generic/029 | 2 +- tests/generic/030 | 2 +- tests/generic/032 | 2 +- tests/generic/034 | 2 +- tests/generic/039 | 2 +- tests/generic/040 | 2 +- tests/generic/041 | 2 +- tests/generic/048 | 2 +- tests/generic/049 | 2 +- tests/generic/051 | 4 ++-- tests/generic/054 | 2 +- tests/generic/057 | 2 +- tests/generic/059 | 2 +- tests/generic/065 | 2 +- tests/generic/066 | 2 +- tests/generic/073 | 2 +- tests/generic/090 | 4 ++-- tests/generic/092 | 2 +- tests/generic/098 | 4 ++-- tests/generic/101 | 2 +- tests/generic/104 | 2 +- tests/generic/106 | 2 +- tests/generic/107 | 2 +- tests/generic/150 | 2 +- tests/generic/151 | 2 +- tests/generic/152 | 2 +- tests/generic/157 | 3 ++- tests/generic/158 | 3 ++- tests/generic/159 | 2 +- tests/generic/160 | 2 +- tests/generic/171 | 4 ++-- tests/generic/172 | 4 ++-- tests/generic/173 | 4 ++-- tests/generic/174 | 4 ++-- tests/generic/204 | 8 -------- tests/generic/247 | 2 +- tests/generic/250 | 2 +- tests/generic/252 | 2 +- tests/generic/265 | 2 +- tests/generic/266 | 2 +- tests/generic/267 | 2 +- tests/generic/268 | 2 +- tests/generic/271 | 2 +- tests/generic/272 | 2 +- tests/generic/273 | 2 +- tests/generic/274 | 6 +++--- tests/generic/275 | 6 +++--- tests/generic/276 | 2 +- tests/generic/278 | 2 +- tests/generic/279 | 2 +- tests/generic/281 | 2 +- tests/generic/282 | 2 +- tests/generic/283 | 2 +- tests/generic/315 | 2 +- tests/generic/317 | 2 +- tests/generic/318 | 2 +- tests/generic/325 | 2 +- tests/generic/328 | 4 ++-- tests/generic/329 | 2 +- tests/generic/330 | 2 +- tests/generic/331 | 2 +- tests/generic/332 | 2 +- tests/generic/335 | 2 +- tests/generic/336 | 2 +- tests/generic/341 | 2 +- tests/generic/342 | 2 +- tests/generic/343 | 2 +- tests/generic/347 | 2 +- tests/generic/348 | 2 +- tests/generic/353 | 2 +- tests/generic/376 | 2 +- tests/generic/382 | 2 +- tests/generic/387 | 2 +- tests/generic/391 | 2 +- tests/generic/409 | 2 +- tests/generic/410 | 2 +- tests/generic/411 | 2 +- tests/generic/416 | 2 +- tests/generic/422 | 4 ++-- tests/generic/425 | 2 +- tests/generic/461 | 2 +- tests/generic/474 | 4 ++-- tests/generic/479 | 2 +- tests/generic/480 | 2 +- tests/generic/483 | 2 +- tests/generic/489 | 2 +- tests/generic/502 | 2 +- tests/generic/505 | 2 +- tests/generic/506 | 2 +- tests/generic/507 | 2 +- tests/generic/508 | 2 +- tests/generic/510 | 2 +- tests/generic/520 | 2 +- tests/generic/526 | 2 +- tests/generic/527 | 2 +- tests/generic/535 | 2 +- tests/generic/546 | 2 +- tests/generic/556 | 2 +- tests/generic/579 | 2 +- tests/generic/589 | 2 +- tests/generic/599 | 2 +- tests/generic/610 | 2 +- tests/generic/628 | 4 ++-- tests/generic/629 | 4 ++-- tests/generic/640 | 2 +- tests/generic/673 | 2 +- tests/generic/674 | 2 +- tests/generic/675 | 2 +- tests/generic/677 | 2 +- tests/generic/683 | 2 +- tests/generic/684 | 2 +- tests/generic/685 | 2 +- tests/generic/686 | 2 +- tests/generic/687 | 2 +- tests/generic/688 | 2 +- tests/generic/690 | 2 +- tests/generic/694 | 2 +- tests/generic/695 | 2 +- tests/generic/703 | 2 +- tests/generic/716 | 2 +- tests/generic/718 | 2 +- tests/generic/719 | 2 +- tests/generic/721 | 2 +- tests/generic/725 | 2 +- tests/generic/726 | 2 +- tests/generic/727 | 2 +- tests/generic/735 | 2 +- tests/generic/738 | 2 +- tests/generic/745 | 4 ++-- tests/generic/746 | 4 ++-- tests/generic/747 | 4 ++-- tests/generic/749 | 4 ++-- tests/xfs/016 | 4 ++-- tests/xfs/052 | 2 +- tests/xfs/110 | 2 +- tests/xfs/118 | 4 ++-- tests/xfs/119 | 2 +- tests/xfs/128 | 2 +- tests/xfs/133 | 2 +- tests/xfs/134 | 2 +- tests/xfs/161 | 2 +- tests/xfs/176 | 2 +- tests/xfs/195 | 2 +- tests/xfs/201 | 4 ++-- tests/xfs/212 | 2 +- tests/xfs/227 | 2 +- tests/xfs/231 | 4 ++-- tests/xfs/232 | 4 ++-- tests/xfs/234 | 2 +- tests/xfs/236 | 2 +- tests/xfs/237 | 2 +- tests/xfs/239 | 2 +- tests/xfs/240 | 2 +- tests/xfs/241 | 2 +- tests/xfs/243 | 4 ++-- tests/xfs/246 | 2 +- tests/xfs/265 | 2 +- tests/xfs/272 | 2 +- tests/xfs/274 | 2 +- tests/xfs/276 | 2 +- tests/xfs/291 | 4 ++-- tests/xfs/309 | 2 +- tests/xfs/312 | 2 +- tests/xfs/313 | 2 +- tests/xfs/314 | 2 +- tests/xfs/315 | 4 ++-- tests/xfs/316 | 2 +- tests/xfs/317 | 2 +- tests/xfs/318 | 4 ++-- tests/xfs/319 | 2 +- tests/xfs/320 | 2 +- tests/xfs/321 | 2 +- tests/xfs/322 | 2 +- tests/xfs/323 | 2 +- tests/xfs/324 | 2 +- tests/xfs/325 | 4 ++-- tests/xfs/326 | 4 ++-- tests/xfs/327 | 2 +- tests/xfs/420 | 2 +- tests/xfs/421 | 2 +- tests/xfs/423 | 2 +- tests/xfs/438 | 2 +- tests/xfs/440 | 2 +- tests/xfs/442 | 2 +- tests/xfs/511 | 2 +- tests/xfs/519 | 2 +- tests/xfs/520 | 2 +- tests/xfs/541 | 2 +- tests/xfs/553 | 4 ++-- tests/xfs/558 | 6 +++--- tests/xfs/607 | 6 +++--- tests/xfs/617 | 2 +- tests/xfs/629 | 2 +- tests/xfs/630 | 2 +- tests/xfs/631 | 2 +- tests/xfs/790 | 2 +- tests/xfs/791 | 2 +- tests/xfs/792 | 2 +- 208 files changed, 279 insertions(+), 249 deletions(-) diff --git a/common/encrypt b/common/encrypt index d90a566ac..52f23cd0a 100644 --- a/common/encrypt +++ b/common/encrypt @@ -686,7 +686,7 @@ _get_ciphertext_block_list() { local file=$1 - sync + _sync_fs $file $XFS_IO_PROG -c fiemap $file | perl -ne ' next if not /^\s*\d+: \[\d+\.\.\d+\]: (\d+)\.\.(\d+)/; print $_ . "," foreach $1..$2;' | sed 's/,$//' diff --git a/common/log b/common/log index ea7e4158e..ab7bc9f87 100644 --- a/common/log +++ b/common/log @@ -392,7 +392,7 @@ _create_log_sync() # add some syncs to get the log flushed to disk for file in $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}; do touch $file - sync + _scratch_sync done # unmount the FS diff --git a/common/quota b/common/quota index 3bf7d552e..e87489192 100644 --- a/common/quota +++ b/common/quota @@ -336,7 +336,7 @@ _qmount_option() _check_quota_usage() { # Sync to get delalloc to disk - sync + _scratch_sync # kill caches to guarantee removal speculative delalloc # XXX: really need an ioctl instead of this big hammer diff --git a/common/rc b/common/rc index a601e2c80..6f939e3b5 100644 --- a/common/rc +++ b/common/rc @@ -6,6 +6,30 @@ BC="$(type -P bc)" || BC= +# Don't use sync(1) directly if at all possible. In most cases we only need to +# sync the fs under test, so we use syncfs if it is supported to prevent +# disturbance of other tests that may be running concurrently. +_sync_fs() +{ + local dir=$1 + + if [ -e $dir ]; then + $XFS_IO_PROG -rxc "syncfs" $dir > /dev/null 2>&1 + return + fi + sync +} + +_scratch_sync() +{ + _sync_fs $SCRATCH_MNT +} + +_test_sync() +{ + _sync_fs $TEST_DIR +} + # Common execution handling for fsstress invocation. # # We need per-test fsstress binaries because of the way fsstress forks and diff --git a/common/repair b/common/repair index 8945d0028..0dae83052 100644 --- a/common/repair +++ b/common/repair @@ -119,7 +119,7 @@ _check_repair() _scratch_mount POSIXLY_CORRECT=yes \ dd if=/bin/bash of=$SCRATCH_MNT/sh 2>&1 |_filter_dd - sync + _scratch_sync rm -f $SCRATCH_MNT/sh _scratch_unmount diff --git a/common/report b/common/report index 0e91e481f..7128bbeba 100644 --- a/common/report +++ b/common/report @@ -156,7 +156,7 @@ ENDL cat $report >> "$tmp_fn" fi echo "" >> "$tmp_fn" - sync "$tmp_fn" && mv "$tmp_fn" "$out_fn" + _sync_fs "$tmp_fn" && mv "$tmp_fn" "$out_fn" echo "Xunit report: $out_fn" } diff --git a/common/verity b/common/verity index 59b67e120..11e839d2e 100644 --- a/common/verity +++ b/common/verity @@ -335,7 +335,7 @@ _fsv_scratch_corrupt_bytes() local dd_cmds=() local cmd - sync # Sync to avoid unwritten extents + _scratch_sync # Sync to avoid unwritten extents cat > $tmp.bytes local end=$(( offset + $(_get_filesize $tmp.bytes ) )) diff --git a/common/xfs b/common/xfs index 68abfa71d..0417a40ad 100644 --- a/common/xfs +++ b/common/xfs @@ -1087,7 +1087,7 @@ _scratch_xfs_unmount_dirty() rm -f "$f" echo "test" > "$f" - sync + _scratch_sync _scratch_shutdown _scratch_unmount } diff --git a/ltp/fsstress.c b/ltp/fsstress.c index a6840f28c..8b8c9035f 100644 --- a/ltp/fsstress.c +++ b/ltp/fsstress.c @@ -5241,6 +5241,18 @@ symlink_f(opnum_t opno, long r) void sync_f(opnum_t opno, long r) { + int fd; + + fd = open(homedir, O_RDONLY|O_DIRECTORY); + if (fd < 0) + goto use_sync; + syncfs(fd); + close(fd); + if (verbose) + printf("%d/%lld: syncfs\n", procid, opno); + return; + +use_sync: sync(); if (verbose) printf("%d/%lld: sync\n", procid, opno); diff --git a/tests/generic/015 b/tests/generic/015 index d4f81c7f6..3cbb2f2d0 100755 --- a/tests/generic/015 +++ b/tests/generic/015 @@ -85,7 +85,7 @@ fi echo "check free space:" -sync +_scratch_sync free2=`_free` if [ -z "$free2" ] diff --git a/tests/generic/029 b/tests/generic/029 index 0af46e892..c6162b0b4 100755 --- a/tests/generic/029 +++ b/tests/generic/029 @@ -43,7 +43,7 @@ echo "==== Post-Remount ==" _hexdump $testfile rm -f $testfile -sync +_scratch_sync # second case is to do a mwrite between the truncate to a block on the # same page we are truncating within the EOF. This checks that a mapped diff --git a/tests/generic/030 b/tests/generic/030 index 3f0e5b993..b1b51469c 100755 --- a/tests/generic/030 +++ b/tests/generic/030 @@ -48,7 +48,7 @@ echo "==== Post-Remount ==" _hexdump $testfile rm -f $testfile -sync +_scratch_sync # second case is to do a mwrite between the truncate to a block on the # same page we are truncating within the EOF. This checks that a mapped diff --git a/tests/generic/032 b/tests/generic/032 index 63abd62a8..30290c722 100755 --- a/tests/generic/032 +++ b/tests/generic/032 @@ -29,7 +29,7 @@ _cleanup() _syncloop() { while [ true ]; do - sync + _scratch_sync done } diff --git a/tests/generic/034 b/tests/generic/034 index 71aae2a01..cd22f330d 100755 --- a/tests/generic/034 +++ b/tests/generic/034 @@ -41,7 +41,7 @@ touch $SCRATCH_MNT/test_dir/foo # The intention is that at log recovery time we have a dir entry for 'foo' both # in the fs/subvol tree and in the log tree - this is necessary to trigger the # bug on btrfs. -sync +_scratch_sync touch $SCRATCH_MNT/test_dir/bar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/test_dir diff --git a/tests/generic/039 b/tests/generic/039 index 5162e85b0..00d4e4afb 100755 --- a/tests/generic/039 +++ b/tests/generic/039 @@ -44,7 +44,7 @@ echo "hello world" > $SCRATCH_MNT/a/b/foo ln $SCRATCH_MNT/a/b/foo $SCRATCH_MNT/a/b/bar # Make sure all metadata and data are durably persisted. -sync +_scratch_sync # Now remove one of the hard links and fsync the inode. rm -f $SCRATCH_MNT/a/b/bar diff --git a/tests/generic/040 b/tests/generic/040 index eb88e9eed..8b4e3b703 100755 --- a/tests/generic/040 +++ b/tests/generic/040 @@ -60,7 +60,7 @@ for i in `seq 1 3000`; do done # Make sure all metadata and data are durably persisted. -sync +_scratch_sync # Add one more link to the inode that ends up being a btrfs extref and fsync # the inode. diff --git a/tests/generic/041 b/tests/generic/041 index 447013689..6d42d1a28 100755 --- a/tests/generic/041 +++ b/tests/generic/041 @@ -64,7 +64,7 @@ for i in `seq 1 3000`; do done # Make sure all metadata and data are durably persisted. -sync +_scratch_sync # Now remove one link, add a new one with a new name, add another new one with # the same name as the one we just removed and fsync the inode. diff --git a/tests/generic/048 b/tests/generic/048 index 7b28cb053..5c554d501 100755 --- a/tests/generic/048 +++ b/tests/generic/048 @@ -69,7 +69,7 @@ do done # sync, then shutdown immediately after, then remount and test -sync +_scratch_sync _scratch_shutdown _scratch_unmount _scratch_mount diff --git a/tests/generic/049 b/tests/generic/049 index 8e4b99565..94b5afe96 100755 --- a/tests/generic/049 +++ b/tests/generic/049 @@ -66,7 +66,7 @@ do done # sync, then shutdown immediately after, then remount and test -sync +_scratch_sync _scratch_shutdown _scratch_unmount _scratch_mount diff --git a/tests/generic/051 b/tests/generic/051 index 69250cde6..5ee4dfdba 100755 --- a/tests/generic/051 +++ b/tests/generic/051 @@ -30,7 +30,7 @@ load_dir=$SCRATCH_MNT/test _run_fsstress_bg -n 10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME _kill_fsstress -sync +_scratch_sync _scratch_unmount # now mount again, run the load again, this time with a shutdown. @@ -38,7 +38,7 @@ _scratch_mount $XFS_FSR_PROG -v $load_dir >> $seqres.full 2>&1 _run_fsstress_bg -n10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME -sync +_scratch_sync # now shutdown and unmount sleep 5 diff --git a/tests/generic/054 b/tests/generic/054 index 20e9a1e96..0649b2593 100755 --- a/tests/generic/054 +++ b/tests/generic/054 @@ -67,7 +67,7 @@ for s in sync nosync ; do # add some syncs to get the log flushed to disk for file in $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}; do touch $file - sync + _scratch_sync done else # generate some log traffic - but not too much - life gets a little diff --git a/tests/generic/057 b/tests/generic/057 index c92af5ddb..c5db80977 100755 --- a/tests/generic/057 +++ b/tests/generic/057 @@ -41,7 +41,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xaa -b 8K 0 8K" \ $SCRATCH_MNT/foo | _filter_xfs_io # Make sure the file is durably persisted. -sync +_scratch_sync # Append some data to our file, to increase its size. $XFS_IO_PROG -f -c "pwrite -S 0xcc -b 4K 8K 4K" \ diff --git a/tests/generic/059 b/tests/generic/059 index 0d3270787..db48de378 100755 --- a/tests/generic/059 +++ b/tests/generic/059 @@ -58,7 +58,7 @@ $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo # that modifies the data or metadata of our file, should update those fields in # the btrfs inode with values that make the next fsync operation write to the # fsync log. -sync +_scratch_sync # Sleep for 1 second, because we want to check that the next punch operations we # do update the file's mtime and ctime. diff --git a/tests/generic/065 b/tests/generic/065 index adf55b750..f7e1e276f 100755 --- a/tests/generic/065 +++ b/tests/generic/065 @@ -42,7 +42,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xaa 0 8K" $SCRATCH_MNT/foo | _filter_xfs_io mkdir $SCRATCH_MNT/mydir # Make sure all metadata and data are durably persisted. -sync +_scratch_sync # Add a hard link to 'foo' inside our test directory and fsync only the # directory. The btrfs fsync implementation had a bug that caused the new diff --git a/tests/generic/066 b/tests/generic/066 index e32e9658b..37d04e069 100755 --- a/tests/generic/066 +++ b/tests/generic/066 @@ -48,7 +48,7 @@ $SETFATTR_PROG -n user.attr2 -v val2 $SCRATCH_MNT/foobar $SETFATTR_PROG -n user.attr3 -v val3 $SCRATCH_MNT/foobar # Make sure everything is durably persisted. -sync +_scratch_sync # Now delete the second xattr and fsync the inode. $SETFATTR_PROG -x user.attr2 $SCRATCH_MNT/foobar diff --git a/tests/generic/073 b/tests/generic/073 index 5ebf634fa..05df1ea87 100755 --- a/tests/generic/073 +++ b/tests/generic/073 @@ -51,7 +51,7 @@ touch $SCRATCH_MNT/testdir_1/bar mkdir $SCRATCH_MNT/testdir_2 # Make sure everything is durably persisted. -sync +_scratch_sync # Write more 8Kb of data to our file. $XFS_IO_PROG -c "pwrite -S 0xbb 8K 8K" $SCRATCH_MNT/foo | _filter_xfs_io diff --git a/tests/generic/090 b/tests/generic/090 index 36a9ee865..b1ea27bbd 100755 --- a/tests/generic/090 +++ b/tests/generic/090 @@ -41,7 +41,7 @@ _mount_flakey $XFS_IO_PROG -f -c "pwrite -S 0xaa 0 32k" \ -c "fsync" \ $SCRATCH_MNT/foo | _filter_xfs_io -sync +_scratch_sync # Add a hard link to our file. # On btrfs this sets the flag BTRFS_INODE_COPY_EVERYTHING on the btrfs inode, @@ -50,7 +50,7 @@ ln $SCRATCH_MNT/foo $SCRATCH_MNT/bar # Sync the filesystem to force a commit of the current btrfs transaction, this # is a necessary condition to trigger the bug on btrfs. -sync +_scratch_sync # Now append more data to our file, increasing its size, and fsync the file. # In btrfs because the inode flag BTRFS_INODE_COPY_EVERYTHING was set and the diff --git a/tests/generic/092 b/tests/generic/092 index d8c223270..3a61f00f7 100755 --- a/tests/generic/092 +++ b/tests/generic/092 @@ -36,7 +36,7 @@ _require_congruent_file_oplen $TEST_DIR $((7 * 1048576)) # past i_size $XFS_IO_PROG -f -c "falloc -k 0 10M" -c "pwrite 0 5M" -c "truncate 5M"\ $TEST_DIR/testfile.$seq | _filter_xfs_io -sync +_test_sync $XFS_IO_PROG -c "fiemap -v" $TEST_DIR/testfile.$seq | _filter_fiemap # Now verify that if we truncate up past i_size we don't trim the preallocated diff --git a/tests/generic/098 b/tests/generic/098 index 57de42e9c..ff6cf908e 100755 --- a/tests/generic/098 +++ b/tests/generic/098 @@ -38,7 +38,7 @@ workout() # Create our test file with some data and durably persist it. $XFS_IO_PROG -t -f -c "pwrite -S 0xaa 0 128K" $SCRATCH_MNT/foo | _filter_xfs_io - sync + _scratch_sync # Append some data to the file, increasing its size, and leave a hole between # the old size and the start offset if the following write. So our file gets @@ -49,7 +49,7 @@ workout() # This is required to trigger a bug in btrfs truncate where it updates on-disk # inode size incorrectly. if [ $need_sync -eq 1 ]; then - sync + _scratch_sync fi # Now truncate our file to a smaller size that is in the middle of the hole we diff --git a/tests/generic/101 b/tests/generic/101 index 2e9543579..4295f0801 100755 --- a/tests/generic/101 +++ b/tests/generic/101 @@ -49,7 +49,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xaa 0 64K" \ $XFS_IO_PROG -f -c "pwrite -S 0xee 0 64K" \ -c "pwrite -S 0xff 64K 61K" \ $SCRATCH_MNT/bar | _filter_xfs_io -sync +_scratch_sync # Now truncate our file foo to a smaller size (64Kb) and then truncate it to the # size it had before the shrinking truncate (125Kb). Then fsync our file. If a diff --git a/tests/generic/104 b/tests/generic/104 index 7f294e1b6..9af3b5582 100755 --- a/tests/generic/104 +++ b/tests/generic/104 @@ -38,7 +38,7 @@ touch $SCRATCH_MNT/testdir/foo touch $SCRATCH_MNT/testdir/bar # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Create one hard link for file foo and another one for file bar. After that # fsync only the file bar. diff --git a/tests/generic/106 b/tests/generic/106 index 2b89ae69a..8bcc7575e 100755 --- a/tests/generic/106 +++ b/tests/generic/106 @@ -37,7 +37,7 @@ touch $SCRATCH_MNT/testdir/foo ln $SCRATCH_MNT/testdir/foo $SCRATCH_MNT/testdir/bar # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now remove one of the links, trigger inode eviction and then fsync our # inode. diff --git a/tests/generic/107 b/tests/generic/107 index 177ca59c5..8a82d1468 100755 --- a/tests/generic/107 +++ b/tests/generic/107 @@ -41,7 +41,7 @@ ln $SCRATCH_MNT/foo $SCRATCH_MNT/testdir/foo2 ln $SCRATCH_MNT/foo $SCRATCH_MNT/testdir/foo3 # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now we remove one of our file's hardlinks in the directory testdir. unlink $SCRATCH_MNT/testdir/foo3 diff --git a/tests/generic/150 b/tests/generic/150 index 159a53c4d..d9a53a5b1 100755 --- a/tests/generic/150 +++ b/tests/generic/150 @@ -38,7 +38,7 @@ sz=$((blksz * blks)) nr=7 filesize=$((blksz * nr)) _pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full -sync +_test_sync free_blocks0=$(stat -f $testdir -c '%f') echo "Create the reflink copies" diff --git a/tests/generic/151 b/tests/generic/151 index a335b9273..d20477ab3 100755 --- a/tests/generic/151 +++ b/tests/generic/151 @@ -43,7 +43,7 @@ free_blocks0=$(stat -f $testdir -c '%f') nr=7 filesize=$((blksz * nr)) _pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full -sync +_test_sync echo "Create the reflink copies" for i in `seq 2 $nr`; do diff --git a/tests/generic/152 b/tests/generic/152 index 8d87dbac7..afcbd6d93 100755 --- a/tests/generic/152 +++ b/tests/generic/152 @@ -44,7 +44,7 @@ free_blocks0=$(stat -f $testdir -c '%f') nr=4 filesize=$((blksz * nr)) _pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full -sync +_test_sync echo "Create the reflink copies" for i in `seq 2 $nr`; do diff --git a/tests/generic/157 b/tests/generic/157 index cb9143673..24415937c 100755 --- a/tests/generic/157 +++ b/tests/generic/157 @@ -54,7 +54,8 @@ seq 1 $((2 * blksz / 250)) | while read f; do done mknod $testdir1/dev1 c 1 3 mkfifo $testdir1/fifo1 -sync +_test_sync +_scratch_sync _filter_enotty() { sed -e 's/Inappropriate ioctl for device/Invalid argument/g' diff --git a/tests/generic/158 b/tests/generic/158 index 171d3c0dc..ccee3690a 100755 --- a/tests/generic/158 +++ b/tests/generic/158 @@ -55,7 +55,8 @@ seq 1 $((2 * blksz / 250)) | while read f; do done mknod $testdir1/dev1 c 1 3 mkfifo $testdir1/fifo1 -sync +_test_sync +_scratch_sync _filter_enotty() { _filter_dedupe_error | \ diff --git a/tests/generic/159 b/tests/generic/159 index c4dec17ca..a2d20622a 100755 --- a/tests/generic/159 +++ b/tests/generic/159 @@ -39,7 +39,7 @@ nr=4 filesize=$((blksz * nr)) _pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full _pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full -sync +_test_sync do_filter_output() { diff --git a/tests/generic/160 b/tests/generic/160 index fc7a161e1..c1f24ddbb 100755 --- a/tests/generic/160 +++ b/tests/generic/160 @@ -39,7 +39,7 @@ nr=4 filesize=$((blksz * nr)) _pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full _pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full -sync +_test_sync do_filter_output() { diff --git a/tests/generic/171 b/tests/generic/171 index dd56aa792..5c8504d26 100755 --- a/tests/generic/171 +++ b/tests/generic/171 @@ -49,12 +49,12 @@ mkdir $testdir echo "Create a big file and reflink it" _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1 _cp_reflink $testdir/bigfile $testdir/clonefile -sync +_scratch_sync echo "Allocate the rest of the space" nr_free=$(stat -f -c '%f' $testdir) _fill_fs $((nr_free * blksz)) $testdir/space $blksz 0 >> $seqres.full 2>&1 -sync +_scratch_sync echo "CoW the big file" out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1 | \ diff --git a/tests/generic/172 b/tests/generic/172 index c23a12284..17f817805 100755 --- a/tests/generic/172 +++ b/tests/generic/172 @@ -47,11 +47,11 @@ mkdir $testdir echo "Create a big file and reflink it" _pwrite_byte 0x61 0 $file_size $testdir/bigfile >> $seqres.full 2>&1 _cp_reflink $testdir/bigfile $testdir/clonefile -sync +_scratch_sync echo "Allocate the rest of the space" _fill_fs $fs_size $testdir/space $blksz 0 >> $seqres.full 2>&1 -sync +_scratch_sync echo "CoW the big file" out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \ diff --git a/tests/generic/173 b/tests/generic/173 index 8df3c6df2..d7ac7b15d 100755 --- a/tests/generic/173 +++ b/tests/generic/173 @@ -49,12 +49,12 @@ mkdir $testdir echo "Create a big file and reflink it" _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1 _cp_reflink $testdir/bigfile $testdir/clonefile -sync +_scratch_sync echo "Allocate the rest of the space" nr_free=$(stat -f -c '%f' $testdir) _fill_fs $((blksz * nr_free)) $testdir/space $blksz 0 >> $seqres.full 2>&1 -sync +_scratch_sync echo "mmap CoW the big file" core_ulimit="$(ulimit -c)" diff --git a/tests/generic/174 b/tests/generic/174 index b9c292071..c7c62001d 100755 --- a/tests/generic/174 +++ b/tests/generic/174 @@ -50,12 +50,12 @@ mkdir $testdir echo "Create a big file and reflink it" _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1 _cp_reflink $testdir/bigfile $testdir/clonefile -sync +_scratch_sync echo "Allocate the rest of the space" nr_free=$(stat -f -c '%f' $testdir) _fill_fs $((blksz * nr_free)) $testdir/space $blksz 0 >> $seqres.full 2>&1 -sync +_scratch_sync echo "CoW the big file" out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1 | \ diff --git a/tests/generic/204 b/tests/generic/204 index 9ef54e239..39483a09a 100755 --- a/tests/generic/204 +++ b/tests/generic/204 @@ -9,17 +9,9 @@ . ./common/preamble _begin_fstest metadata rw auto -# Override the default cleanup function. -_cleanup() -{ - rm -f $tmp.* - sync -} - # Import common functions. . ./common/filter - _require_scratch # For xfs, we need to handle the different default log sizes that different diff --git a/tests/generic/247 b/tests/generic/247 index 47ff5c343..a758ae24c 100755 --- a/tests/generic/247 +++ b/tests/generic/247 @@ -39,7 +39,7 @@ iosize=1048576 # Initialise file dd if=/dev/zero of=$testfile bs=$iosize count=$loops &> /dev/null [ $? -ne 0 ] && exit -sync +_test_sync # Direct I/O overwriter dd if=/dev/zero of=$testfile oflag=direct bs=$iosize count=$loops conv=notrunc &> /dev/null & diff --git a/tests/generic/250 b/tests/generic/250 index 196a34bb0..605d7c8ad 100755 --- a/tests/generic/250 +++ b/tests/generic/250 @@ -61,7 +61,7 @@ md5sum $testdir/file2 | _filter_scratch echo "Write and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ >> $seqres.full 2>&1 diff --git a/tests/generic/252 b/tests/generic/252 index 3ee2b0a67..ddf950e34 100755 --- a/tests/generic/252 +++ b/tests/generic/252 @@ -64,7 +64,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _dmerror_load_working_table diff --git a/tests/generic/265 b/tests/generic/265 index 3c84e2a84..0f165e7e6 100755 --- a/tests/generic/265 +++ b/tests/generic/265 @@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \ -c "fdatasync" $testdir/file2 2>&1) diff --git a/tests/generic/266 b/tests/generic/266 index d5675afbc..02e290de5 100755 --- a/tests/generic/266 +++ b/tests/generic/266 @@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \ -c "fdatasync" $testdir/file2 2>&1) diff --git a/tests/generic/267 b/tests/generic/267 index ddaf1064c..48b1981f1 100755 --- a/tests/generic/267 +++ b/tests/generic/267 @@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full 2>&1 _dmerror_load_working_table diff --git a/tests/generic/268 b/tests/generic/268 index c6068cf4e..f46e0b755 100755 --- a/tests/generic/268 +++ b/tests/generic/268 @@ -54,7 +54,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \ -c "fdatasync" $testdir/file2 2>&1) diff --git a/tests/generic/271 b/tests/generic/271 index ce647d155..854ea1021 100755 --- a/tests/generic/271 +++ b/tests/generic/271 @@ -54,7 +54,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1) echo $urk >> $seqres.full diff --git a/tests/generic/272 b/tests/generic/272 index 3d2cace9f..bc77365df 100755 --- a/tests/generic/272 +++ b/tests/generic/272 @@ -54,7 +54,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1) echo $urk >> $seqres.full diff --git a/tests/generic/273 b/tests/generic/273 index e0ee0483a..5100e848b 100755 --- a/tests/generic/273 +++ b/tests/generic/273 @@ -92,7 +92,7 @@ _porter() echo "_porter $_suffix not complete" fi - sync + _scratch_sync } _do_workload() diff --git a/tests/generic/274 b/tests/generic/274 index d526a9b71..916c7173c 100755 --- a/tests/generic/274 +++ b/tests/generic/274 @@ -50,7 +50,7 @@ echo "Fill fs with 1M IOs; ENOSPC expected" >> $seqres.full dd if=/dev/zero of=$SCRATCH_MNT/tmp1 bs=1M >>$seqres.full 2>&1 echo "Fill fs with 4K IOs; ENOSPC expected" >> $seqres.full dd if=/dev/zero of=$SCRATCH_MNT/tmp2 bs=4K >>$seqres.full 2>&1 -sync +_scratch_sync # Last effort, use O_SYNC echo "Fill fs with 4K DIOs; ENOSPC expected" >> $seqres.full dd if=/dev/zero of=$SCRATCH_MNT/tmp3 bs=4K oflag=sync >>$seqres.full 2>&1 @@ -66,7 +66,7 @@ for i in `seq 1 2 1023`; do dd if=/dev/zero of=$SCRATCH_MNT/test seek=$i bs=4K count=1 conv=notrunc \ >>$seqres.full 2>/dev/null || _fail "failed to write to test file" done -sync +_scratch_sync echo >> $seqres.full echo "Fill in prealloc space; fill holes at offsets:" >> $seqres.full for i in `seq 2 2 1023`; do @@ -74,7 +74,7 @@ for i in `seq 2 2 1023`; do dd if=/dev/zero of=$SCRATCH_MNT/test seek=$i bs=4K count=1 conv=notrunc \ >>$seqres.full 2>/dev/null || _fail "failed to fill test file" done -sync +_scratch_sync echo >> $seqres.full echo "done" diff --git a/tests/generic/275 b/tests/generic/275 index 57de69b80..fbfe15816 100755 --- a/tests/generic/275 +++ b/tests/generic/275 @@ -51,9 +51,9 @@ dd if=/dev/zero of=$SCRATCH_MNT/tmp1 bs=256K count=1 >>$seqres.full 2>&1 # Attempt to completely fill fs dd if=/dev/zero of=$SCRATCH_MNT/tmp2 bs=1M >>$seqres.full 2>&1 -sync +_scratch_sync dd if=/dev/zero of=$SCRATCH_MNT/tmp3 bs=4K >>$seqres.full 2>&1 -sync +_scratch_sync # Last effort, use O_SYNC dd if=/dev/zero of=$SCRATCH_MNT/tmp4 bs=4K oflag=sync >>$seqres.full 2>&1 # Save space usage info to the full file @@ -62,7 +62,7 @@ $DF_PROG $SCRATCH_MNT >>$seqres.full 2>&1 # Should leave approx 256k free rm -f $SCRATCH_MNT/tmp1 -sync +_scratch_sync echo "Post rm space:" >> $seqres.full $DF_PROG $SCRATCH_MNT >>$seqres.full 2>&1 _freespace=`$DF_PROG -k $SCRATCH_MNT | tail -n 1 | awk '{print $5}'` diff --git a/tests/generic/276 b/tests/generic/276 index 3c3e75df6..dfd2888ce 100755 --- a/tests/generic/276 +++ b/tests/generic/276 @@ -54,7 +54,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table $XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ >> $seqres.full 2>&1 diff --git a/tests/generic/278 b/tests/generic/278 index 5d9778f9f..e303a74ce 100755 --- a/tests/generic/278 +++ b/tests/generic/278 @@ -55,7 +55,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1) echo $urk >> $seqres.full diff --git a/tests/generic/279 b/tests/generic/279 index f4dac950c..599b4b6dc 100755 --- a/tests/generic/279 +++ b/tests/generic/279 @@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table # Insulate ourselves against bash reporting the SIGBUS when we try to modify # the metadata. diff --git a/tests/generic/281 b/tests/generic/281 index 6d48c4b14..474b8b73a 100755 --- a/tests/generic/281 +++ b/tests/generic/281 @@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table # Insulate ourselves against bash reporting the SIGBUS when we try to modify # the metadata. diff --git a/tests/generic/282 b/tests/generic/282 index b3eb48063..727978130 100755 --- a/tests/generic/282 +++ b/tests/generic/282 @@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table # Insulate ourselves against bash reporting the SIGBUS when we try to modify # the metadata. diff --git a/tests/generic/283 b/tests/generic/283 index b9104fe64..cdad47a24 100755 --- a/tests/generic/283 +++ b/tests/generic/283 @@ -54,7 +54,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table # Insulate ourselves against bash reporting the SIGBUS when we try to modify # the metadata. diff --git a/tests/generic/315 b/tests/generic/315 index 83f46655f..cb660ed2d 100755 --- a/tests/generic/315 +++ b/tests/generic/315 @@ -41,7 +41,7 @@ fsize=`_get_filesize $TEST_DIR/testfile.$seq` # Truncate the file size back to 0 truncate -s 0 $TEST_DIR/testfile.$seq -sync +_test_sync # Preallocated disk space should be released avail_done=`df -P $TEST_DIR | awk 'END {print $4}'` diff --git a/tests/generic/317 b/tests/generic/317 index 177d88525..1afec6a75 100755 --- a/tests/generic/317 +++ b/tests/generic/317 @@ -73,7 +73,7 @@ _print_numeric_uid echo "" echo "*** Remounting ***" echo "" -sync +_scratch_sync _scratch_cycle_mount >>$seqres.full 2>&1 || _fail "remount failed" _print_numeric_uid diff --git a/tests/generic/318 b/tests/generic/318 index d31ad2b13..033c0611c 100755 --- a/tests/generic/318 +++ b/tests/generic/318 @@ -81,7 +81,7 @@ _print_getfacls echo "*** Remounting ***" echo "" -sync +_scratch_sync _scratch_cycle_mount >>$seqres.full 2>&1 || _fail "remount failed" _print_getfacls diff --git a/tests/generic/325 b/tests/generic/325 index 8fbd0d1d9..f85066337 100755 --- a/tests/generic/325 +++ b/tests/generic/325 @@ -42,7 +42,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xff 0 256K" $SCRATCH_MNT/foo | _filter_xfs_io # Now sync the file data to disk using 'sync' and not an fsync. This is because # in btrfs the first fsync clears the btrfs inode full fsync flag, which must # be set when the first msync below happens in order to trigger the bug. -sync +_scratch_sync # Now update the first 4Kb and the last 4Kb of the file, using memory mapped IO # because an msync(), since the linux kernel commit diff --git a/tests/generic/328 b/tests/generic/328 index 25e1f2a02..7071ded25 100755 --- a/tests/generic/328 +++ b/tests/generic/328 @@ -62,12 +62,12 @@ _report_quota_blocks $SCRATCH_MNT echo "Try to dio write the whole file" _pwrite_byte 0x62 0 $sz $testdir/file1 -d >> $seqres.full -sync +_scratch_sync _report_quota_blocks $SCRATCH_MNT echo "Try to write the whole file" _pwrite_byte 0x62 0 $sz $testdir/file3 >> $seqres.full -sync +_scratch_sync _report_quota_blocks $SCRATCH_MNT # success, all done diff --git a/tests/generic/329 b/tests/generic/329 index ab37e047f..e4300f92c 100755 --- a/tests/generic/329 +++ b/tests/generic/329 @@ -57,7 +57,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _dmerror_load_working_table diff --git a/tests/generic/330 b/tests/generic/330 index 4fa81f991..c67defc48 100755 --- a/tests/generic/330 +++ b/tests/generic/330 @@ -51,7 +51,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full -sync +_scratch_sync $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full $AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _scratch_cycle_mount diff --git a/tests/generic/331 b/tests/generic/331 index c1949e1b9..fe12ec4eb 100755 --- a/tests/generic/331 +++ b/tests/generic/331 @@ -57,7 +57,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full $XFS_IO_PROG -c "fdatasync" $testdir/file2 diff --git a/tests/generic/332 b/tests/generic/332 index 4a61e4a02..cb15e77bd 100755 --- a/tests/generic/332 +++ b/tests/generic/332 @@ -52,7 +52,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync $AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _scratch_cycle_mount diff --git a/tests/generic/335 b/tests/generic/335 index 280cf8538..f287b5150 100755 --- a/tests/generic/335 +++ b/tests/generic/335 @@ -38,7 +38,7 @@ mkdir $SCRATCH_MNT/c touch $SCRATCH_MNT/a/b/foo # Make sure everything is durably persisted. -sync +_scratch_sync # Now move our test file into a new parent directory. mv $SCRATCH_MNT/a/b/foo $SCRATCH_MNT/c/ diff --git a/tests/generic/336 b/tests/generic/336 index 478081978..06391a93f 100755 --- a/tests/generic/336 +++ b/tests/generic/336 @@ -43,7 +43,7 @@ ln $SCRATCH_MNT/a/foo $SCRATCH_MNT/b/foo_link touch $SCRATCH_MNT/b/bar # Make sure everything is durably persisted. -sync +_scratch_sync # Now delete one of the hard links of file foo and move file bar into c/ unlink $SCRATCH_MNT/b/foo_link diff --git a/tests/generic/341 b/tests/generic/341 index bea36e265..80fdcbac7 100755 --- a/tests/generic/341 +++ b/tests/generic/341 @@ -36,7 +36,7 @@ mkdir -p $SCRATCH_MNT/a/x $XFS_IO_PROG -f -c "pwrite -S 0xaf 0 32K" $SCRATCH_MNT/a/x/foo | _filter_xfs_io $XFS_IO_PROG -f -c "pwrite -S 0xba 0 32K" $SCRATCH_MNT/a/x/bar | _filter_xfs_io # Make sure everything done so far is durably persisted. -sync +_scratch_sync echo "File digests before power failure:" md5sum $SCRATCH_MNT/a/x/foo | _filter_scratch diff --git a/tests/generic/342 b/tests/generic/342 index 3f5aca673..a7aca860b 100755 --- a/tests/generic/342 +++ b/tests/generic/342 @@ -40,7 +40,7 @@ _mount_flakey mkdir $SCRATCH_MNT/a $XFS_IO_PROG -f -c "pwrite -S 0xf1 0 16K" $SCRATCH_MNT/a/foo | _filter_xfs_io # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now rename file foo to bar and create a new file named foo under the same # directory. After a power failure we must see the two files. diff --git a/tests/generic/343 b/tests/generic/343 index 6659f1988..97ff4f984 100755 --- a/tests/generic/343 +++ b/tests/generic/343 @@ -41,7 +41,7 @@ mkdir $SCRATCH_MNT/y/z touch $SCRATCH_MNT/y/foo2 # Make sure everything is durably persisted. -sync +_scratch_sync # Now add a link to foo at directory x, move directory z and file foo2 from # directory y to directory x and fsync foo's inode. We expect that after a diff --git a/tests/generic/347 b/tests/generic/347 index 7e1ea5d90..5c0e3f949 100755 --- a/tests/generic/347 +++ b/tests/generic/347 @@ -36,7 +36,7 @@ _workout() $XFS_IO_PROG -f -c "pwrite -W 0 1M" $SCRATCH_MNT/file$I &>/dev/null done - sync + _scratch_sync _dmthin_grow $GROW_SIZE diff --git a/tests/generic/348 b/tests/generic/348 index eb0587d20..1905a6e6a 100755 --- a/tests/generic/348 +++ b/tests/generic/348 @@ -35,7 +35,7 @@ _mount_flakey mkdir $SCRATCH_MNT/testdir1 # Make sure it's durably persisted. -sync +_scratch_sync # Create our symlinks and fsync their parent directories. # We test both the case where the parent directory is new (not yet durably diff --git a/tests/generic/353 b/tests/generic/353 index ac5b97880..2114a74cb 100755 --- a/tests/generic/353 +++ b/tests/generic/353 @@ -48,7 +48,7 @@ cmp -s $extmap1 $extmap2 || echo "mismatched extent maps before sync" # sync and recheck, to make sure the fiemap doesn't change just # due to sync -sync +_scratch_sync $XFS_IO_PROG -c "fiemap -v" $file1 | _filter_fiemap_flags > $extmap1 $XFS_IO_PROG -c "fiemap -v" $file2 | _filter_fiemap_flags > $extmap2 diff --git a/tests/generic/376 b/tests/generic/376 index cecd4e0d7..17a5f290b 100755 --- a/tests/generic/376 +++ b/tests/generic/376 @@ -36,7 +36,7 @@ _mount_flakey mkdir $SCRATCH_MNT/dir touch $SCRATCH_MNT/dir/foo # Make sure everything is durably persisted. -sync +_scratch_sync mv $SCRATCH_MNT/dir/foo $SCRATCH_MNT/dir/bar touch $SCRATCH_MNT/dir/foo $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/dir/bar diff --git a/tests/generic/382 b/tests/generic/382 index 162da41d4..1634d85d2 100755 --- a/tests/generic/382 +++ b/tests/generic/382 @@ -56,7 +56,7 @@ do_test() for ((i=0; i<30; i++));do _user_do "echo -n > ${SCRATCH_MNT}/file${i}" done - sync + _scratch_sync rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1 } diff --git a/tests/generic/387 b/tests/generic/387 index 544e7552a..c3b972496 100755 --- a/tests/generic/387 +++ b/tests/generic/387 @@ -37,7 +37,7 @@ done # consume all remaining free space dd if=/dev/zero of=$SCRATCH_MNT/space >/dev/null 2>&1 -sync +_scratch_sync # fs is full now and fs internal operations may need some free space, for # example, in btrfs, transaction will need to reserve space first, so here free diff --git a/tests/generic/391 b/tests/generic/391 index d19c48262..e41f644d3 100755 --- a/tests/generic/391 +++ b/tests/generic/391 @@ -38,7 +38,7 @@ for ((off = 0; off < num_extents * extent_size; off += extent_size)); do done # To reproduce the Btrfs bug, the extent map must not be cached in memory. -sync +_test_sync echo 3 > /proc/sys/vm/drop_caches "$here/src/dio-interleaved" "$extent_size" "$num_extents" "$testfile" diff --git a/tests/generic/409 b/tests/generic/409 index ab7e7eb55..ac1b14ad6 100755 --- a/tests/generic/409 +++ b/tests/generic/409 @@ -58,7 +58,7 @@ fs_stress() -f getdents=1 \ -f fiemap=1 \ -d $target - sync + _sync_fs $target } # prepare some mountpoint dir diff --git a/tests/generic/410 b/tests/generic/410 index f0f0921be..e0d0c57eb 100755 --- a/tests/generic/410 +++ b/tests/generic/410 @@ -66,7 +66,7 @@ fs_stress() -f getdents=1 \ -f fiemap=1 \ -d $target - sync + _sync_fs $target } # prepare some mountpoint dir diff --git a/tests/generic/411 b/tests/generic/411 index 3b55b4f91..0a80554cd 100755 --- a/tests/generic/411 +++ b/tests/generic/411 @@ -49,7 +49,7 @@ fs_stress() -f getdents=1 \ -f fiemap=1 \ -d $target - sync + _sync_fs $target } # prepare some mountpoint dir diff --git a/tests/generic/416 b/tests/generic/416 index 31a85c83f..f6a516fb6 100755 --- a/tests/generic/416 +++ b/tests/generic/416 @@ -52,7 +52,7 @@ _scratch_remount # remove all files with odd file names, which should free near half # of the space rm $SCRATCH_MNT/*[13579] -sync +_scratch_sync # We should be able to write at least 1/8 of the whole fs size # The number 1/8 is for btrfs, which only has about 47M for data. diff --git a/tests/generic/422 b/tests/generic/422 index 71a0e5a86..ad37b9cea 100755 --- a/tests/generic/422 +++ b/tests/generic/422 @@ -34,7 +34,7 @@ $XFS_IO_PROG -f \ touch $SCRATCH_MNT/foo4 # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now overwrite the extent of the first file. $XFS_IO_PROG -c "pwrite -S 0xff 0 64K" $SCRATCH_MNT/foo1 | _filter_xfs_io @@ -77,7 +77,7 @@ space_used > $SCRATCH_MNT/$seq.before cat $SCRATCH_MNT/$seq.before ) >> $seqres.full -sync +_scratch_sync # We expect the same file sizes reported by 'du' after writeback finishes. diff --git a/tests/generic/425 b/tests/generic/425 index 3367a9567..352ae32d2 100755 --- a/tests/generic/425 +++ b/tests/generic/425 @@ -52,7 +52,7 @@ while [ $i -lt $max_attrs ]; do $SETFATTR_PROG -n "user.$n" -v "$n" $testfile > $seqres.full 2>&1 || break i=$((i + 1)) done -sync +_scratch_sync echo "Check attr extent counts" f1=$(_count_attr_extents $testfile) diff --git a/tests/generic/461 b/tests/generic/461 index 95dd6a34d..a2927f85e 100755 --- a/tests/generic/461 +++ b/tests/generic/461 @@ -27,7 +27,7 @@ load_dir=$SCRATCH_MNT/test _run_fsstress_bg -n10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME -sync +_scratch_sync # now shutdown and unmount sleep 5 diff --git a/tests/generic/474 b/tests/generic/474 index 2fa087a87..961d0f06f 100755 --- a/tests/generic/474 +++ b/tests/generic/474 @@ -36,7 +36,7 @@ _scratch_mount # accelerates syncfs on testing filesystem so that test case can finish # in 30 seconds. -sync +_scratch_sync # Large fs has a huge size .use_space file, will take long time on running # fssum $SCRATCH_MNT. So change the target path to a sub-dir of $SCRATCH_MNT. @@ -47,7 +47,7 @@ $XFS_IO_PROG -f -c "pwrite 0 4K" $localdir/testfile >/dev/null 2>&1 # fssum used for comparing checksum of test file(data & metedata), # exclude checking about atime, block structure, open error. $FSSUM_PROG -ugomAcdES -f -w $tmp.fssum $localdir -$XFS_IO_PROG -c "syncfs" $localdir/testfile >/dev/null 2>&1 +_sync_fs $localdir/testfile _scratch_shutdown _scratch_cycle_mount $FSSUM_PROG -r $tmp.fssum $localdir diff --git a/tests/generic/479 b/tests/generic/479 index 7f4aab4e7..650c921b8 100755 --- a/tests/generic/479 +++ b/tests/generic/479 @@ -53,7 +53,7 @@ run_test() _fail "Invalid file type argument: $file_type" esac # Make sure everything done so far is durably persisted. - sync + _scratch_sync # Create a file and fsync it just to create a journal/log. This file # must be in the same directory as our special file "foo". diff --git a/tests/generic/480 b/tests/generic/480 index 975c990ff..6c599446b 100755 --- a/tests/generic/480 +++ b/tests/generic/480 @@ -38,7 +38,7 @@ touch $SCRATCH_MNT/testdir/foo ln $SCRATCH_MNT/testdir/foo $SCRATCH_MNT/testdir/bar # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now remove of the links of our file and create a new file with the same name # and in the same parent directory, and finally fsync this new file. diff --git a/tests/generic/483 b/tests/generic/483 index 60f9b1097..a71f96ad0 100755 --- a/tests/generic/483 +++ b/tests/generic/483 @@ -57,7 +57,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xf1 0 256K" \ $SCRATCH_MNT/baz >/dev/null # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Allocate an extent beyond the size of the first test file and fsync it. $XFS_IO_PROG -c "falloc -k 256K 1M"\ diff --git a/tests/generic/489 b/tests/generic/489 index 62aa45a86..e76055fa4 100755 --- a/tests/generic/489 +++ b/tests/generic/489 @@ -39,7 +39,7 @@ $SETFATTR_PROG -n user.xa3 -v test $SCRATCH_MNT/foobar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foobar # Call sync to commit all fileystem metadata. -sync +_scratch_sync $XFS_IO_PROG -c "pwrite -S 0xea 0 64K" \ -c "fsync" \ diff --git a/tests/generic/502 b/tests/generic/502 index f6374f677..f488bd06c 100755 --- a/tests/generic/502 +++ b/tests/generic/502 @@ -46,7 +46,7 @@ touch $SCRATCH_MNT/testdir/foo ln $SCRATCH_MNT/testdir/foo $SCRATCH_MNT/testdir/bar # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now rename the first hard link (foo) to a new name and rename the second hard # link (bar) to the old name of the first hard link (foo). diff --git a/tests/generic/505 b/tests/generic/505 index a25967352..eb44573b4 100755 --- a/tests/generic/505 +++ b/tests/generic/505 @@ -40,7 +40,7 @@ do_check() touch $testfile if [ "$1" == "sync" ]; then - sync + _scratch_sync fi chown 100 $testfile diff --git a/tests/generic/506 b/tests/generic/506 index 9a41e5634..397e93d07 100755 --- a/tests/generic/506 +++ b/tests/generic/506 @@ -45,7 +45,7 @@ do_check() touch $testfile if [ "$1" == "sync" ]; then - sync + _scratch_sync fi $XFS_IO_PROG -x -c "chproj 100" $testfile diff --git a/tests/generic/507 b/tests/generic/507 index 6678e50f7..b9e58067e 100755 --- a/tests/generic/507 +++ b/tests/generic/507 @@ -59,7 +59,7 @@ do_check() if [ "$2" == "sync" ]; then echo "sync" >> $seqres.full - sync + _scratch_sync fi echo "Test chattr +$1" >> $seqres.full diff --git a/tests/generic/508 b/tests/generic/508 index 4e234160d..02023cf08 100755 --- a/tests/generic/508 +++ b/tests/generic/508 @@ -44,7 +44,7 @@ do_check() touch $testfile if [ "$1" == "sync" ]; then - sync + _scratch_sync fi before=`$XFS_IO_PROG -f $testfile -c "statx -v" | grep btime` diff --git a/tests/generic/510 b/tests/generic/510 index 5ea0e0677..abf18f1bf 100755 --- a/tests/generic/510 +++ b/tests/generic/510 @@ -39,7 +39,7 @@ mkdir $SCRATCH_MNT/testdir/B touch $SCRATCH_MNT/testdir/B/bar # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now move our file bar from directory B to directory A and then replace # directory B with directory A, also renaming directory A to B. Finally diff --git a/tests/generic/520 b/tests/generic/520 index 00fa050e2..f2523fca2 100755 --- a/tests/generic/520 +++ b/tests/generic/520 @@ -125,7 +125,7 @@ test_link_sync() mkdir -p "${dest%/*}" touch $src ln $src $dest - sync + _scratch_sync before=`stat "$stat_opt" $src` check_consistency $src 0 diff --git a/tests/generic/526 b/tests/generic/526 index 7d47cf111..af77ccaff 100755 --- a/tests/generic/526 +++ b/tests/generic/526 @@ -43,7 +43,7 @@ echo -n "foo" > $SCRATCH_MNT/testdir/fname1 echo -n "hello" > $SCRATCH_MNT/testdir/fname2 # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Rename and link files such that one new name corresponds to the name of # another renamed file and one new file has the old name of one of the renamed diff --git a/tests/generic/527 b/tests/generic/527 index 2ba1f319b..90555077f 100755 --- a/tests/generic/527 +++ b/tests/generic/527 @@ -49,7 +49,7 @@ ln $SCRATCH_MNT/testdir2/zz $SCRATCH_MNT/testdir2/zz_link echo -n "hello" > $SCRATCH_MNT/testdir2/a # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Rename, remove and link files such that one new name corresponds to the name # of a deleted file and one new file has the old name of the renamed file. Then diff --git a/tests/generic/535 b/tests/generic/535 index c2338da6b..98e2f2384 100755 --- a/tests/generic/535 +++ b/tests/generic/535 @@ -59,7 +59,7 @@ do_check() echo "Test chmod $target" >> $seqres.full chmod 777 $target - sync + _scratch_sync chmod 755 $target $XFS_IO_PROG $target -c "fsync" diff --git a/tests/generic/546 b/tests/generic/546 index 972886858..ab4ea657e 100755 --- a/tests/generic/546 +++ b/tests/generic/546 @@ -47,7 +47,7 @@ _pwrite_byte 0x00 0 512m "$SCRATCH_MNT/padding" >> $seqres.full 2>&1 # Sync to ensure that padding file reach disk so that at log recovery we # still have no data space -sync +_scratch_sync # This should not fail _pwrite_byte 0xcd 1m 16m "$SCRATCH_MNT/foobar" >> $seqres.full diff --git a/tests/generic/556 b/tests/generic/556 index d3396ae3b..279ff58b3 100755 --- a/tests/generic/556 +++ b/tests/generic/556 @@ -366,7 +366,7 @@ test_toplevel_dir_rename() # 'f2fs: don't use casefolded comparison for "." and ".."'. mkdir ${dir} _casefold_set_attr ${dir} - sync + _scratch_sync echo 2 > /proc/sys/vm/drop_caches mv ${dir} ${dir}.new } diff --git a/tests/generic/579 b/tests/generic/579 index 4187ab0f0..d5fab4892 100755 --- a/tests/generic/579 +++ b/tests/generic/579 @@ -86,7 +86,7 @@ done ( while [ ! -e $tmp.done ]; do sleep 2.$((RANDOM % 100)) - sync && echo 3 > /proc/sys/vm/drop_caches + _scratch_sync && echo 3 > /proc/sys/vm/drop_caches done ) & diff --git a/tests/generic/589 b/tests/generic/589 index 969a8ac61..b5860070b 100755 --- a/tests/generic/589 +++ b/tests/generic/589 @@ -48,7 +48,7 @@ fs_stress() local target=$1 _run_fsstress -n 50 -p 3 -d $target - sync + _sync_fs $target } # prepare some mountpoint dir diff --git a/tests/generic/599 b/tests/generic/599 index e1454584f..a8eb93709 100755 --- a/tests/generic/599 +++ b/tests/generic/599 @@ -24,7 +24,7 @@ _scratch_mount localdir=$SCRATCH_MNT/dir mkdir $localdir -sync +_scratch_sync # fssum used for comparing checksum of test file(data & metedata), # exclude checking about atime, block structure, open error. diff --git a/tests/generic/610 b/tests/generic/610 index 22f28c6df..00a676e6e 100755 --- a/tests/generic/610 +++ b/tests/generic/610 @@ -30,7 +30,7 @@ $here/src/punch-alternating $SCRATCH_MNT/foobar >>$seqres.full # For btrfs, trigger a transaction commit to force metadata COW for the # following fallocate zero range operation. -sync +_scratch_sync $XFS_IO_PROG -c "fzero 0 100M" $SCRATCH_MNT/foobar diff --git a/tests/generic/628 b/tests/generic/628 index 8fd44364c..6f891abc2 100755 --- a/tests/generic/628 +++ b/tests/generic/628 @@ -54,7 +54,7 @@ $XFS_IO_PROG -f -c 'pwrite -S 0x59 0 1m -b 1m' $SCRATCH_MNT/c >> $seqres.full _cp_reflink $SCRATCH_MNT/a $SCRATCH_MNT/e _cp_reflink $SCRATCH_MNT/c $SCRATCH_MNT/d touch $SCRATCH_MNT/b -sync +_scratch_sync # Test that reflink forces dirty data/metadata to disk when destination file # opened with O_SYNC @@ -81,7 +81,7 @@ rm -f $SCRATCH_MNT/b $SCRATCH_MNT/d _cp_reflink $SCRATCH_MNT/c $SCRATCH_MNT/d touch $SCRATCH_MNT/b chattr +S $SCRATCH_MNT/b $SCRATCH_MNT/d -sync +_scratch_sync # Test that reflink forces dirty data/metadata to disk when destination file # has the sync iflag set diff --git a/tests/generic/629 b/tests/generic/629 index 92b7839a0..1088e50e4 100755 --- a/tests/generic/629 +++ b/tests/generic/629 @@ -50,7 +50,7 @@ md5sum $SCRATCH_MNT/0 | _filter_scratch # Set up initial files for copy test $XFS_IO_PROG -f -c 'pwrite -S 0x58 0 1m -b 1m' $SCRATCH_MNT/a >> $seqres.full touch $SCRATCH_MNT/b -sync +_scratch_sync # Test that unaligned copy file range forces dirty data/metadata to disk when # destination file opened with O_SYNC @@ -66,7 +66,7 @@ md5sum $SCRATCH_MNT/a $SCRATCH_MNT/b | _filter_scratch rm -f $SCRATCH_MNT/b touch $SCRATCH_MNT/b chattr +S $SCRATCH_MNT/b -sync +_scratch_sync # Test that unaligned copy file range forces dirty data/metadata to disk when # destination file has the sync iflag set diff --git a/tests/generic/640 b/tests/generic/640 index 038dde975..c3b33746e 100755 --- a/tests/generic/640 +++ b/tests/generic/640 @@ -38,7 +38,7 @@ mkdir $SCRATCH_MNT/B echo -n "hello world" > $SCRATCH_MNT/A/foo # Persist everything done so far. -sync +_scratch_sync # Add some new file to directory A and fsync the directory. touch $SCRATCH_MNT/A/bar diff --git a/tests/generic/673 b/tests/generic/673 index 1230b51e1..8f6def9c7 100755 --- a/tests/generic/673 +++ b/tests/generic/673 @@ -28,7 +28,7 @@ setup_testfile() { _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full _pwrite_byte 0x57 0 1m $SCRATCH_MNT/b >> $seqres.full chmod a+r $SCRATCH_MNT/b - sync + _scratch_sync } commit_and_check() { diff --git a/tests/generic/674 b/tests/generic/674 index 2e395290a..1b711f27f 100755 --- a/tests/generic/674 +++ b/tests/generic/674 @@ -29,7 +29,7 @@ setup_testfile() { _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full _pwrite_byte 0x58 0 1m $SCRATCH_MNT/b >> $seqres.full chmod a+r $SCRATCH_MNT/b - sync + _scratch_sync } commit_and_check() { diff --git a/tests/generic/675 b/tests/generic/675 index 7c062db81..e66de84b5 100755 --- a/tests/generic/675 +++ b/tests/generic/675 @@ -33,7 +33,7 @@ setup_testfile() { _pwrite_byte 0x57 0 1m $SCRATCH_MNT/b >> $seqres.full chmod a+rwx $SCRATCH_MNT/a $SCRATCH_MNT/b $SETCAP_PROG cap_setgid,cap_setuid+ep $SCRATCH_MNT/a - sync + _scratch_sync } commit_and_check() { diff --git a/tests/generic/677 b/tests/generic/677 index f2081c34c..86099454f 100755 --- a/tests/generic/677 +++ b/tests/generic/677 @@ -62,7 +62,7 @@ $XFS_IO_PROG -c "falloc -k 20M 1M" $SCRATCH_MNT/foo # On btrfs this commits the current transaction and it makes all the created # extents to have a generation lower than the generation of the transaction used # by the next write and fsync. -sync +_scratch_sync # Now overwrite only the first extent. # On btrfs, due to COW (both data and metadata), that results in modifying only diff --git a/tests/generic/683 b/tests/generic/683 index cf1ebbc44..cc9a9786b 100755 --- a/tests/generic/683 +++ b/tests/generic/683 @@ -36,7 +36,7 @@ chmod a+rw $junk_dir/ setup_testfile() { rm -f $junk_file _pwrite_byte 0x58 0 192k $junk_file >> $seqres.full - sync + _test_sync } commit_and_check() { diff --git a/tests/generic/684 b/tests/generic/684 index e1eb4e118..2ca036fe5 100755 --- a/tests/generic/684 +++ b/tests/generic/684 @@ -36,7 +36,7 @@ chmod a+rw $junk_dir/ setup_testfile() { rm -f $junk_file _pwrite_byte 0x58 0 192k $junk_file >> $seqres.full - sync + _test_sync } commit_and_check() { diff --git a/tests/generic/685 b/tests/generic/685 index bec2c5a0b..de07a798a 100755 --- a/tests/generic/685 +++ b/tests/generic/685 @@ -36,7 +36,7 @@ chmod a+rw $junk_dir/ setup_testfile() { rm -f $junk_file _pwrite_byte 0x58 0 192k $junk_file >> $seqres.full - sync + _test_sync } commit_and_check() { diff --git a/tests/generic/686 b/tests/generic/686 index efcc3f610..fc6761fe6 100755 --- a/tests/generic/686 +++ b/tests/generic/686 @@ -36,7 +36,7 @@ chmod a+rw $junk_dir/ setup_testfile() { rm -f $junk_file _pwrite_byte 0x58 0 192k $junk_file >> $seqres.full - sync + _test_sync } commit_and_check() { diff --git a/tests/generic/687 b/tests/generic/687 index e05f0fdcd..82dce88b8 100755 --- a/tests/generic/687 +++ b/tests/generic/687 @@ -36,7 +36,7 @@ chmod a+rw $junk_dir/ setup_testfile() { rm -f $junk_file _pwrite_byte 0x58 0 192k $junk_file >> $seqres.full - sync + _test_sync } commit_and_check() { diff --git a/tests/generic/688 b/tests/generic/688 index 9c19356d8..e491d5cf3 100755 --- a/tests/generic/688 +++ b/tests/generic/688 @@ -40,7 +40,7 @@ setup_testfile() { touch $junk_file chmod a+rwx $junk_file $SETCAP_PROG cap_setgid,cap_setuid+ep $junk_file - sync + _test_sync } commit_and_check() { diff --git a/tests/generic/690 b/tests/generic/690 index ba0da30d3..ef5bd1983 100755 --- a/tests/generic/690 +++ b/tests/generic/690 @@ -52,7 +52,7 @@ _mount_flakey mkdir "$SCRATCH_MNT"/testdir # Commit the current transaction and persist the directory. -sync +_scratch_sync # Create a file in the test directory, so that the next fsync on the directory # actually does something (it logs the directory). diff --git a/tests/generic/694 b/tests/generic/694 index a68fc5230..e5c4f88c5 100755 --- a/tests/generic/694 +++ b/tests/generic/694 @@ -39,7 +39,7 @@ fi # make sure indirect block reservations and other temporary block reservations # are released before sampling i_blocks -sync $junk_file +_test_sync iblocks=`stat -c '%b' $junk_file` diff --git a/tests/generic/695 b/tests/generic/695 index 8179d59a0..df81fdb7f 100755 --- a/tests/generic/695 +++ b/tests/generic/695 @@ -51,7 +51,7 @@ $XFS_IO_PROG -f -c "truncate 12M" \ $SCRATCH_MNT/foobar | _filter_xfs_io # Persist everything, commit the filesystem's transaction. -sync +_scratch_sync # Now punch two holes in the file: # diff --git a/tests/generic/703 b/tests/generic/703 index 8ee1d558c..2bace19d6 100755 --- a/tests/generic/703 +++ b/tests/generic/703 @@ -70,7 +70,7 @@ fi $XFS_IO_PROG -c "falloc 0 256M" $test_file # Persist everything, make sure the file exists after power failure. -sync +_scratch_sync echo -e "Running fio with config:\n" >> $seqres.full cat $fio_config >> $seqres.full diff --git a/tests/generic/716 b/tests/generic/716 index a2b86225a..d3923dc1d 100755 --- a/tests/generic/716 +++ b/tests/generic/716 @@ -36,7 +36,7 @@ filesnap() { mkfile() { rm -f $dir/a _pwrite_byte 0x58 0 $((blksz * nrblks)) $dir/a >> $seqres.full - sync + _test_sync } dir=$TEST_DIR/test-$seq diff --git a/tests/generic/718 b/tests/generic/718 index ed3a1fee5..4d322b224 100755 --- a/tests/generic/718 +++ b/tests/generic/718 @@ -31,7 +31,7 @@ nrblks=64 # Create some 4M files to test exchangerange _pwrite_byte 0x58 0 $((blksz * nrblks)) $dir/a >> $seqres.full _pwrite_byte 0x59 0 $((blksz * nrblks)) $dir/b >> $seqres.full -sync +_test_sync md5sum $dir/a $dir/b | _filter_test_dir # Set FSIZE to twice the blocksize (IOWs, 128k) diff --git a/tests/generic/719 b/tests/generic/719 index c82cf9552..9cd6eed91 100755 --- a/tests/generic/719 +++ b/tests/generic/719 @@ -34,7 +34,7 @@ filesnap() { mkfile() { rm -f $dir/a _pwrite_byte 0x58 0 $((blksz * nrblks)) $dir/a >> $seqres.full - sync + _test_sync } dir=$TEST_DIR/test-$seq diff --git a/tests/generic/721 b/tests/generic/721 index 98505aac9..a9565f189 100755 --- a/tests/generic/721 +++ b/tests/generic/721 @@ -35,7 +35,7 @@ mkfile() { rm -f $dir/a _pwrite_byte 0x58 0 $((blksz * nrblks)) $dir/a >> $seqres.full chown $qa_user $dir/a $dir/ - sync + _test_sync } dir=$TEST_DIR/test-$seq diff --git a/tests/generic/725 b/tests/generic/725 index e1db83b5e..3a9005ddf 100755 --- a/tests/generic/725 +++ b/tests/generic/725 @@ -31,7 +31,7 @@ _require_congruent_file_oplen $SCRATCH_MNT 65536 # Create original file _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full -sync +_scratch_sync md5sum $SCRATCH_MNT/a | _filter_scratch # Test atomic scatter-gather file commits. diff --git a/tests/generic/726 b/tests/generic/726 index 00071b1d0..131ac5b50 100755 --- a/tests/generic/726 +++ b/tests/generic/726 @@ -35,7 +35,7 @@ chmod a+rw $SCRATCH_MNT/ setup_testfile() { rm -f $SCRATCH_MNT/a _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full - sync + _scratch_sync } commit_and_check() { diff --git a/tests/generic/727 b/tests/generic/727 index dbed1d45c..ee7ed9760 100755 --- a/tests/generic/727 +++ b/tests/generic/727 @@ -42,7 +42,7 @@ setup_testfile() { _pwrite_byte 0x57 0 1m $SCRATCH_MNT/b >> $seqres.full chmod a+rw $SCRATCH_MNT/a $SCRATCH_MNT/b $SETCAP_PROG cap_setgid,cap_setuid+ep $SCRATCH_MNT/a - sync + _scratch_sync } commit_and_check() { diff --git a/tests/generic/735 b/tests/generic/735 index 1aeeb9a42..9bbdf3a17 100755 --- a/tests/generic/735 +++ b/tests/generic/735 @@ -42,7 +42,7 @@ $XFS_IO_PROG -f -c "finsert 1M ${finsert_len}" "${SCRATCH_MNT}/file" >> $seqres. # Filling up the free space ensures that the pre-allocated space is the reserved space. nr_free=$(stat -f -c '%f' ${SCRATCH_MNT}) _fill_fs $((nr_free * file_blksz)) ${SCRATCH_MNT}/fill $file_blksz 0 >> $seqres.full 2>&1 -sync +_scratch_sync # Remove reserved space to gain free space for allocation rm -f ${SCRATCH_MNT}/tmp diff --git a/tests/generic/738 b/tests/generic/738 index 4da2d8879..6f1ea7f8f 100755 --- a/tests/generic/738 +++ b/tests/generic/738 @@ -36,7 +36,7 @@ $XFS_IO_PROG -fc "pwrite 0 64k" $SCRATCH_MNT/testfile >> $seqres.full for i in $(seq 0 1024); do create_eof_block_file $SCRATCH_MNT/$i done -sync +_scratch_sync xfs_freeze -f $SCRATCH_MNT # This will hang if bug reproduces diff --git a/tests/generic/745 b/tests/generic/745 index bed43578a..62624b15b 100755 --- a/tests/generic/745 +++ b/tests/generic/745 @@ -51,7 +51,7 @@ _mount_flakey # Create the test file with some initial data and make sure everything is # durably persisted. $XFS_IO_PROG -f -c "pwrite -S 0xaa 0 32k" $SCRATCH_MNT/foo | _filter_xfs_io -sync +_scratch_sync # Add many small xattrs to our file. # We create such a large amount because it's needed to trigger the issue found @@ -66,7 +66,7 @@ done # Sync the filesystem to force a commit of the current btrfs transaction, this # is a necessary condition to trigger the bug on btrfs. -sync +_scratch_sync # Now update our file's data and fsync the file. # After a successful fsync, if the fsync log/journal is replayed we expect to diff --git a/tests/generic/746 b/tests/generic/746 index 651affe07..5734f254d 100755 --- a/tests/generic/746 +++ b/tests/generic/746 @@ -170,7 +170,7 @@ for i in `seq 1 10`; do done # Get reference fiemap, this can contain i.e. uninitialized inode table -sync +_sync_fs $loop_mnt get_holes > $fiemap_ref # Delete some files @@ -184,7 +184,7 @@ echo "done." echo -n "Detecting interesting holes in image..." # Get after-trim fiemap -sync +_sync_fs $loop_mnt get_holes > $fiemap_after echo "done." diff --git a/tests/generic/747 b/tests/generic/747 index b92098f9f..448341866 100755 --- a/tests/generic/747 +++ b/tests/generic/747 @@ -57,7 +57,7 @@ _used_percent() { _delete_random_file() { local to_delete=$(find ${SCRATCH_MNT} -type f | shuf | head -1) rm $to_delete - sync ${SCRATCH_MNT} + _scratch_sync } _get_random_fsz() { @@ -110,7 +110,7 @@ echo "Starting mixed write/delete test using buffered IO" _mixed_write_delete "" echo "Syncing" -sync ${SCRATCH_MNT}/* +_scratch_sync echo "Done, all good" diff --git a/tests/generic/749 b/tests/generic/749 index 8b2c7feff..fc7477380 100755 --- a/tests/generic/749 +++ b/tests/generic/749 @@ -100,7 +100,7 @@ do_mmap_tests() $XFS_IO_PROG -f -c "pwrite -S 0xaa -b 512 $offset $len" \ $test_file >> $seqres.full - sync + _scratch_sync new_filelen=$(_get_filesize $test_file) map_len=$(_round_up_to_page_boundary $new_filelen) csum_orig="$(_md5_checksum $test_file)" @@ -141,7 +141,7 @@ do_mmap_tests() -c "mmap -w 0 $map_len" \ -c "mwrite $new_filelen $zero_filled_data_len" \ -c "munmap" - sync + _scratch_sync csum_post="$(_md5_checksum $test_file)" if [[ "$csum_orig" != "$csum_post" ]]; then let failed=$failed+1 diff --git a/tests/xfs/016 b/tests/xfs/016 index 1abc06c42..f8076cc8d 100755 --- a/tests/xfs/016 +++ b/tests/xfs/016 @@ -101,9 +101,9 @@ _log_traffic() while [ $count -ge 0 ] do touch $out - sync + _scratch_sync rm $out - sync + _scratch_sync let "count = count - 1" done diff --git a/tests/xfs/052 b/tests/xfs/052 index adeab5380..af6e938e0 100755 --- a/tests/xfs/052 +++ b/tests/xfs/052 @@ -54,7 +54,7 @@ fi # create 100 (fs-blocksize) blocks _file_as_id $SCRATCH_MNT/foo $id $type $dbsize 220 -sync +_scratch_sync # set limit at 1001 (1k) blocks bsoft=1001 diff --git a/tests/xfs/110 b/tests/xfs/110 index 0c8c87ea9..fc51d183f 100755 --- a/tests/xfs/110 +++ b/tests/xfs/110 @@ -43,7 +43,7 @@ do done wait -sync +_scratch_sync I=10030585 E=10030599 diff --git a/tests/xfs/118 b/tests/xfs/118 index 73e429384..b5a1eabf7 100755 --- a/tests/xfs/118 +++ b/tests/xfs/118 @@ -38,7 +38,7 @@ echo "Silence is golden" # preallocation added. Let's say... 64k free chunks. $XFS_IO_PROG -fs -c "falloc 0 40000k" $SCRATCH_MNT/fill >> $seqres.full 2>&1 -sync +_scratch_sync dd if=/dev/zero of=$SCRATCH_MNT/remainder oflag=direct > /dev/null 2>&1 @@ -55,7 +55,7 @@ for I in `seq 1 64`; do >> $seqres.full 2>&1 done # sync to get extents on disk so fsr sees them -sync +_scratch_sync # Free up some space for defragmentation temp file rm -f $SCRATCH_MNT/fill diff --git a/tests/xfs/119 b/tests/xfs/119 index 334d06934..7c1cd6a50 100755 --- a/tests/xfs/119 +++ b/tests/xfs/119 @@ -30,7 +30,7 @@ _require_scratch _require_freeze # this may hang -sync +_scratch_sync export MKFS_OPTIONS="-l version=2,su=64k" logblks=$(_scratch_find_xfs_min_logblocks) diff --git a/tests/xfs/128 b/tests/xfs/128 index 0f1905295..0bfda0e06 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -42,7 +42,7 @@ blksz_factor=$((blksz / real_blksz)) # preallocate space to try to produce a single extent. $XFS_IO_PROG -f -c "falloc 0 $((blks * blksz))" $testdir/file1 >> $seqres.full _pwrite_byte 0x61 0 $((blks * blksz)) $testdir/file1 >> $seqres.full -sync +_scratch_sync nextents=$($XFS_IO_PROG -c 'stat' $testdir/file1 | grep 'fsxattr.nextents' | awk '{print $3}') diff --git a/tests/xfs/133 b/tests/xfs/133 index 39f4f74ae..c9bae5d92 100755 --- a/tests/xfs/133 +++ b/tests/xfs/133 @@ -49,7 +49,7 @@ fi echo "Remount, try to append" _scratch_mount dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)." -sync +_scratch_sync # success, all done status=0 diff --git a/tests/xfs/134 b/tests/xfs/134 index b86265211..77505718a 100755 --- a/tests/xfs/134 +++ b/tests/xfs/134 @@ -52,7 +52,7 @@ fi echo "Remount, try to append" _scratch_mount dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=direct,append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)." -sync +_scratch_sync # success, all done status=0 diff --git a/tests/xfs/161 b/tests/xfs/161 index 948121c05..e13a646a5 100755 --- a/tests/xfs/161 +++ b/tests/xfs/161 @@ -51,7 +51,7 @@ lim_bhard=$(( 100 * blksz )) # Force the block counters for uid 1 and 2 above zero _pwrite_byte 0x61 0 $filesz $SCRATCH_MNT/a >> $seqres.full _pwrite_byte 0x61 0 $filesz $SCRATCH_MNT/b >> $seqres.full -sync +_scratch_sync chown 1 $SCRATCH_MNT/a chown 2 $SCRATCH_MNT/b diff --git a/tests/xfs/176 b/tests/xfs/176 index 8d58590fd..e3fa87c43 100755 --- a/tests/xfs/176 +++ b/tests/xfs/176 @@ -151,7 +151,7 @@ for ((ino = icluster_ino; ino < icluster_ino + XFS_INODES_PER_CHUNK; ino++)); do find $SCRATCH_MNT/urk/ -inum "$ino" -print0 | xargs -r -0 mv -t $SCRATCH_MNT/save/ done rm -rf $SCRATCH_MNT/urk/ $SCRATCH_MNT/save/*/* -sync +_scratch_sync $XFS_IO_PROG -c 'fsmap -vvvvv' $SCRATCH_MNT &>> $seqres.full # Propose shrinking the filesystem such that the end of the fs ends up in the diff --git a/tests/xfs/195 b/tests/xfs/195 index f965d9c38..9d23c32dc 100755 --- a/tests/xfs/195 +++ b/tests/xfs/195 @@ -56,7 +56,7 @@ $CHATTR_PROG +d $TEST_DIR/d/t _do_dump echo "Dump exclude flag set, after sync (should be skipped)" -sync +_test_sync _do_dump # success, all done diff --git a/tests/xfs/201 b/tests/xfs/201 index 60cc84ed2..ffd05f8a9 100755 --- a/tests/xfs/201 +++ b/tests/xfs/201 @@ -64,8 +64,8 @@ do_pwrite 5000 6455 $min_align do_pwrite 1728 4999 $min_align do_pwrite 0 1727 $min_align -sync -sync +_scratch_sync +_scratch_sync # and truncate it again > $SCRATCH_MNT/bigfile diff --git a/tests/xfs/212 b/tests/xfs/212 index 54ece22ab..51d211164 100755 --- a/tests/xfs/212 +++ b/tests/xfs/212 @@ -52,7 +52,7 @@ echo "CoW and leave leftovers" $XFS_IO_PROG -f -c "extsize" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((filesize - 1)) 1" -c "fsync" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((filesize - 1)) 1" -c "fsync" $testdir/file2.chk >> $seqres.full -sync +_scratch_sync echo "Crash and recover" $XFS_IO_PROG -x -c "shutdown" $testdir/file2 >> $seqres.full diff --git a/tests/xfs/227 b/tests/xfs/227 index 3f01b175e..2ad910cbd 100755 --- a/tests/xfs/227 +++ b/tests/xfs/227 @@ -60,7 +60,7 @@ fragment_freespace() $XFS_IO_PROG -f -c "unresvsp ${i}k 4k" $_file \ > /dev/null 2>&1 done - sync + _scratch_sync # and now use up all the remaining extents larger than 3 blocks $XFS_IO_PROG -fs -c "resvsp 0 4m" $_file.large > /dev/null 2>&1 diff --git a/tests/xfs/231 b/tests/xfs/231 index c01682fa8..ea494a152 100755 --- a/tests/xfs/231 +++ b/tests/xfs/231 @@ -71,7 +71,7 @@ seq 2 2 $((nr - 1)) | while read f; do $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2.chk >> $seqres.full done -sync +_scratch_sync echo "Wait for CoW expiration" sleep 3 @@ -88,7 +88,7 @@ seq 2 2 $((nr - 1)) | while read f; do $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2.chk >> $seqres.full done -sync +_scratch_sync echo "Compare files" md5sum $testdir/file1 | _filter_scratch diff --git a/tests/xfs/232 b/tests/xfs/232 index c7eba95a4..0eea2c098 100755 --- a/tests/xfs/232 +++ b/tests/xfs/232 @@ -74,7 +74,7 @@ seq 2 2 $((nr - 1)) | while read f; do $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2.chk >> $seqres.full done -sync +_scratch_sync echo "Wait for CoW expiration" $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * 2)) 1" $testdir/file2 >> $seqres.full @@ -92,7 +92,7 @@ seq 2 2 $((nr - 1)) | while read f; do $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2.chk >> $seqres.full done -sync +_scratch_sync echo "Compare files" md5sum $testdir/file1 | _filter_scratch diff --git a/tests/xfs/234 b/tests/xfs/234 index 4d6e30c0a..e57bf38cb 100755 --- a/tests/xfs/234 +++ b/tests/xfs/234 @@ -39,7 +39,7 @@ echo "Create the original file blocks" blksz="$(_get_block_size $testdir)" nr_blks=$((4 * blksz / 12)) _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full -sync +_scratch_sync echo "Punch every other block" seq 1 2 $((nr_blks - 1)) | while read nr; do diff --git a/tests/xfs/236 b/tests/xfs/236 index a374a300d..29cab3190 100755 --- a/tests/xfs/236 +++ b/tests/xfs/236 @@ -38,7 +38,7 @@ nr_blks=$((8 * blksz / 12)) for i in 1 2 x; do _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full _pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/file2 >> $seqres.full - sync + _scratch_sync echo "$i: Reflink every other block" seq 1 2 $((nr_blks - 1)) | while read nr; do diff --git a/tests/xfs/237 b/tests/xfs/237 index 194cd0459..f172aaf59 100755 --- a/tests/xfs/237 +++ b/tests/xfs/237 @@ -60,7 +60,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _dmerror_load_working_table diff --git a/tests/xfs/239 b/tests/xfs/239 index bfe722c0a..11a0d125a 100755 --- a/tests/xfs/239 +++ b/tests/xfs/239 @@ -56,7 +56,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full -sync +_scratch_sync $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full $AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _scratch_cycle_mount diff --git a/tests/xfs/240 b/tests/xfs/240 index 4f9311e8e..e95cf3f5d 100755 --- a/tests/xfs/240 +++ b/tests/xfs/240 @@ -62,7 +62,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full $XFS_IO_PROG -c "fdatasync" $testdir/file2 diff --git a/tests/xfs/241 b/tests/xfs/241 index 153249397..6d73d48e4 100755 --- a/tests/xfs/241 +++ b/tests/xfs/241 @@ -57,7 +57,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync $AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _scratch_cycle_mount diff --git a/tests/xfs/243 b/tests/xfs/243 index ea83a7b44..964e94e1d 100755 --- a/tests/xfs/243 +++ b/tests/xfs/243 @@ -66,7 +66,7 @@ seq 3 5 $nr | while read f; do _pwrite_byte 0x71 $((blksz * f)) $blksz $testdir/file3 >> $seqres.full _pwrite_byte 0x71 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full done -sync +_scratch_sync # 4 blocks are delalloc (do later) seq 4 5 $nr | while read f; do _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3 >> $seqres.full @@ -102,7 +102,7 @@ echo "Regular data extents:" test $(_xfs_bmapx_find data $testdir/file3 -E '00[01]{4}$') -gt 0 || \ echo "Expected to find a regular data extent" -sync +_scratch_sync echo "Dump extents after sync" $XFS_IO_PROG -c "cowextsize" $testdir/file3 | _filter_scratch diff --git a/tests/xfs/246 b/tests/xfs/246 index ce97fad5d..997a7ad47 100755 --- a/tests/xfs/246 +++ b/tests/xfs/246 @@ -25,7 +25,7 @@ mkdir $testdir echo "Create the original files" touch $testdir/file1 -sync +_scratch_sync echo "Dump extents after sync" echo "Hole CoW extents:" diff --git a/tests/xfs/265 b/tests/xfs/265 index 21de4c054..e7f939c14 100755 --- a/tests/xfs/265 +++ b/tests/xfs/265 @@ -44,7 +44,7 @@ for i in 1 2 x; do seq 1 $nr_blks | while read nr; do _cp_reflink $testdir/file1 $testdir/file1.$nr >> $seqres.full done - sync + _scratch_sync echo "$i: Truncate files" seq 1 $nr_blks | while read nr; do diff --git a/tests/xfs/272 b/tests/xfs/272 index b65e2fae5..3e3ceec51 100755 --- a/tests/xfs/272 +++ b/tests/xfs/272 @@ -33,7 +33,7 @@ _scratch_mount _xfs_force_bdev data $SCRATCH_MNT _pwrite_byte 0x80 0 737373 $SCRATCH_MNT/urk >> $seqres.full -sync +_scratch_sync $here/src/punch-alternating $SCRATCH_MNT/urk >> $seqres.full ino=$(stat -c '%i' $SCRATCH_MNT/urk) diff --git a/tests/xfs/274 b/tests/xfs/274 index d06e7fc13..a6bdc7c03 100755 --- a/tests/xfs/274 +++ b/tests/xfs/274 @@ -32,7 +32,7 @@ _scratch_mkfs > "$seqres.full" 2>&1 _scratch_mount _pwrite_byte 0x80 0 737373 $SCRATCH_MNT/f1 >> $seqres.full -sync +_scratch_sync $here/src/punch-alternating $SCRATCH_MNT/f1 >> $seqres.full _cp_reflink $SCRATCH_MNT/f1 $SCRATCH_MNT/f2 ino=$(stat -c '%i' $SCRATCH_MNT/f1) diff --git a/tests/xfs/276 b/tests/xfs/276 index f21f7a86e..69de69d86 100755 --- a/tests/xfs/276 +++ b/tests/xfs/276 @@ -37,7 +37,7 @@ _scratch_mount test $rtextsz -eq $dbsize || _notrun "Skipping test due to rtextsize > 1 fsb" $XFS_IO_PROG -f -R -c 'pwrite -S 0x80 0 737373' $SCRATCH_MNT/urk >> $seqres.full -sync +_scratch_sync $here/src/punch-alternating $SCRATCH_MNT/urk >> $seqres.full ino=$(stat -c '%i' $SCRATCH_MNT/urk) diff --git a/tests/xfs/291 b/tests/xfs/291 index 0141c075b..777968a92 100755 --- a/tests/xfs/291 +++ b/tests/xfs/291 @@ -41,12 +41,12 @@ mkdir $SCRATCH_MNT/fragdir for I in `seq 0 26200`; do (echo data > $SCRATCH_MNT/fragdir/f$I) >> $seqres.full 2>&1 done -sync +_scratch_sync for I in `seq 0 2 26200`; do rm -f $SCRATCH_MNT/fragdir/f$I >> $seqres.full 2>&1 done -sync +_scratch_sync # Soak up any remaining freespace $XFS_IO_PROG -f -c "pwrite 0 16m" -c "fsync" $SCRATCH_MNT/space_file.large >> $seqres.full 2>&1 diff --git a/tests/xfs/309 b/tests/xfs/309 index 63ca0a67b..429a506c2 100755 --- a/tests/xfs/309 +++ b/tests/xfs/309 @@ -44,7 +44,7 @@ for i in 1 2 x; do seq 1 $nr_blks | while read nr; do _cp_reflink $testdir/file1 $testdir/file1.$nr >> $seqres.full done - sync + _scratch_sync echo "$i: Truncate files" seq 1 $nr_blks | while read nr; do diff --git a/tests/xfs/312 b/tests/xfs/312 index 6e47d442b..4c0fbf74a 100755 --- a/tests/xfs/312 +++ b/tests/xfs/312 @@ -45,7 +45,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch diff --git a/tests/xfs/313 b/tests/xfs/313 index d0c77db8b..8f533041b 100755 --- a/tests/xfs/313 +++ b/tests/xfs/313 @@ -44,7 +44,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch diff --git a/tests/xfs/314 b/tests/xfs/314 index 07596e00b..b86d06ae7 100755 --- a/tests/xfs/314 +++ b/tests/xfs/314 @@ -45,7 +45,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch diff --git a/tests/xfs/315 b/tests/xfs/315 index f6c346e18..af783a7ad 100755 --- a/tests/xfs/315 +++ b/tests/xfs/315 @@ -43,7 +43,7 @@ echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full _pwrite_byte 0x66 $((sz / 2)) $((sz / 2)) $SCRATCH_MNT/file2 >> $seqres.full _reflink_range $SCRATCH_MNT/file1 0 $SCRATCH_MNT/file2 0 $((sz / 2)) >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch @@ -54,7 +54,7 @@ _scratch_inject_error "free_extent" echo "CoW a few blocks" $XFS_IO_PROG -c "pwrite -W -S 0x67 -b $sz 0 $sz" $SCRATCH_MNT/file1 >> $seqres.full 2>&1 -sync +_scratch_sync echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch diff --git a/tests/xfs/316 b/tests/xfs/316 index 63711ed47..3c92d1a1d 100755 --- a/tests/xfs/316 +++ b/tests/xfs/316 @@ -45,7 +45,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch diff --git a/tests/xfs/317 b/tests/xfs/317 index 192107f59..2ae0b903c 100755 --- a/tests/xfs/317 +++ b/tests/xfs/317 @@ -36,7 +36,7 @@ _scratch_mount >> $seqres.full echo "Create files" touch $SCRATCH_MNT/file1 _pwrite_byte 0x67 0 $sz $SCRATCH_MNT/file0 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file0 | _filter_scratch diff --git a/tests/xfs/318 b/tests/xfs/318 index 590d268e6..4ff11be40 100755 --- a/tests/xfs/318 +++ b/tests/xfs/318 @@ -43,7 +43,7 @@ touch $SCRATCH_MNT/file1 echo "Write files" $XFS_IO_PROG -c "pwrite -S 0x67 0 $sz" $SCRATCH_MNT/file1 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 2>&1 | _filter_scratch @@ -53,7 +53,7 @@ _scratch_inject_error "free_extent" echo "Remove files" rm -rf $SCRATCH_MNT/file1 -sync +_scratch_sync $XFS_IO_PROG -x -c 'freeze' -c 'thaw' $SCRATCH_MNT >> $seqres.full 2>&1 echo "FS should be shut down, touch will fail" diff --git a/tests/xfs/319 b/tests/xfs/319 index 45b958d8f..66f191127 100755 --- a/tests/xfs/319 +++ b/tests/xfs/319 @@ -38,7 +38,7 @@ echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2 _pwrite_byte 0x67 0 $sz $SCRATCH_MNT/file3 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch diff --git a/tests/xfs/320 b/tests/xfs/320 index f7e4949a3..4cf174b88 100755 --- a/tests/xfs/320 +++ b/tests/xfs/320 @@ -37,7 +37,7 @@ _scratch_mount >> $seqres.full echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2 -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch diff --git a/tests/xfs/321 b/tests/xfs/321 index a09e4a8ce..4ebde3e2a 100755 --- a/tests/xfs/321 +++ b/tests/xfs/321 @@ -37,7 +37,7 @@ _scratch_mount >> $seqres.full echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full $XFS_IO_PROG -f -c "truncate $sz" $SCRATCH_MNT/file3 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch diff --git a/tests/xfs/322 b/tests/xfs/322 index 4cb36a515..0492b647e 100755 --- a/tests/xfs/322 +++ b/tests/xfs/322 @@ -39,7 +39,7 @@ _require_congruent_file_oplen $SCRATCH_MNT $blksz echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full $XFS_IO_PROG -f -c "truncate $sz" $SCRATCH_MNT/file3 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch diff --git a/tests/xfs/323 b/tests/xfs/323 index 0579d4a72..ee45ba608 100755 --- a/tests/xfs/323 +++ b/tests/xfs/323 @@ -37,7 +37,7 @@ _scratch_mount >> $seqres.full echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full _pwrite_byte 0x67 0 $sz $SCRATCH_MNT/file3 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch diff --git a/tests/xfs/324 b/tests/xfs/324 index 485b16215..b86bb0ea8 100755 --- a/tests/xfs/324 +++ b/tests/xfs/324 @@ -45,7 +45,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch diff --git a/tests/xfs/325 b/tests/xfs/325 index 2387b8d88..f06eda64e 100755 --- a/tests/xfs/325 +++ b/tests/xfs/325 @@ -39,7 +39,7 @@ _scratch_mount >> $seqres.full echo "Create files" _pwrite_byte 0x66 0 $((blksz * blks)) $SCRATCH_MNT/file1 >> $seqres.full _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2 -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch @@ -52,7 +52,7 @@ echo "Inject error" _scratch_inject_error "free_extent" rm $SCRATCH_MNT/file1 -sync +_scratch_sync $XFS_IO_PROG -x -c 'freeze' -c 'thaw' $SCRATCH_MNT >> $seqres.full 2>&1 echo "FS should be shut down, touch will fail" diff --git a/tests/xfs/326 b/tests/xfs/326 index 5d7afe9bf..a06879c3e 100755 --- a/tests/xfs/326 +++ b/tests/xfs/326 @@ -62,7 +62,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch @@ -70,7 +70,7 @@ md5sum $SCRATCH_MNT/file2 | _filter_scratch md5sum $SCRATCH_MNT/file3 | _filter_scratch $XFS_IO_PROG -c "pwrite -W -S 0x67 $((10 * blksz)) 1" $SCRATCH_MNT/file2 >> $seqres.full -sync +_scratch_sync echo "Inject error" _scratch_inject_error "refcount_finish_one" diff --git a/tests/xfs/327 b/tests/xfs/327 index 44728c117..1f2ee5484 100755 --- a/tests/xfs/327 +++ b/tests/xfs/327 @@ -37,7 +37,7 @@ _pwrite_byte 0x66 0 1 $SCRATCH_MNT/file.0 >> $seqres.full seq 1 $nr | while read i; do _cp_reflink $SCRATCH_MNT/file.0 $SCRATCH_MNT/file.$i done -sync +_scratch_sync ino_0=$(stat -c '%i' $SCRATCH_MNT/file.0) ino_64=$(stat -c '%i' $SCRATCH_MNT/file.64) diff --git a/tests/xfs/420 b/tests/xfs/420 index 038682ef9..37fb8c6b8 100755 --- a/tests/xfs/420 +++ b/tests/xfs/420 @@ -109,7 +109,7 @@ md5sum $testdir/file3 | _filter_scratch echo 1 > /proc/sys/vm/drop_caches echo "sync filesystem" | tee -a $seqres.full -sync +_scratch_sync $XFS_IO_PROG -c "bmap -ev" -c "bmap -cv" $testdir/file1 >> $seqres.full 2>&1 $XFS_IO_PROG -c "bmap -ev" -c "bmap -cv" $testdir/file2 >> $seqres.full 2>&1 diff --git a/tests/xfs/421 b/tests/xfs/421 index ab565e1f6..fdee45ce4 100755 --- a/tests/xfs/421 +++ b/tests/xfs/421 @@ -94,7 +94,7 @@ md5sum $testdir/file3 | _filter_scratch echo 1 > /proc/sys/vm/drop_caches echo "sync filesystem" | tee -a $seqres.full -sync +_scratch_sync $XFS_IO_PROG -c "bmap -ev" -c "bmap -cv" $testdir/file1 >> $seqres.full 2>&1 $XFS_IO_PROG -c "bmap -ev" -c "bmap -cv" $testdir/file2 >> $seqres.full 2>&1 diff --git a/tests/xfs/423 b/tests/xfs/423 index 1fbf500d8..78fd91301 100755 --- a/tests/xfs/423 +++ b/tests/xfs/423 @@ -31,7 +31,7 @@ _scratch_mount $XFS_IO_PROG -f -c 'falloc 0 10m' $SCRATCH_MNT/a >> $seqres.full $XFS_IO_PROG -f -c 'falloc 0 10m' $SCRATCH_MNT/b >> $seqres.full $here/src/punch-alternating $SCRATCH_MNT/b -sync +_scratch_sync echo "Set up delalloc extents" $XFS_IO_PROG -c 'pwrite -S 0x66 10m 128k' $SCRATCH_MNT/a >> $seqres.full diff --git a/tests/xfs/438 b/tests/xfs/438 index 0239778c5..6d1988c8b 100755 --- a/tests/xfs/438 +++ b/tests/xfs/438 @@ -136,7 +136,7 @@ $DMSETUP_PROG table >> $seqres.full $XFS_QUOTA_PROG -x -c "limit -u isoft=400 $qa_user" $SCRATCH_MNT $XFS_QUOTA_PROG -x -c "report -ih" $SCRATCH_MNT >> $seqres.full -sync +_scratch_sync # wait for the push of the dquota log item in AIL and # the completion of the retried write of dquota buffer diff --git a/tests/xfs/440 b/tests/xfs/440 index fc7319449..0cc679aeb 100755 --- a/tests/xfs/440 +++ b/tests/xfs/440 @@ -43,7 +43,7 @@ $XFS_IO_PROG -c 'stat -r' $SCRATCH_MNT/a | grep stat.size >> $seqres.full _report_quota_blocks "-u $SCRATCH_MNT" echo "Sync" -sync +_scratch_sync _report_quota_blocks "-u $SCRATCH_MNT" echo "Chown and check quota" diff --git a/tests/xfs/442 b/tests/xfs/442 index 5cbd8dd19..58e56b5d2 100755 --- a/tests/xfs/442 +++ b/tests/xfs/442 @@ -36,7 +36,7 @@ compare_quota_to_du() { # This ensures that we did the quota accounting correctly and that we're # accurately reporting cow preallocation blocks in stat. check_quota_du_blocks() { - sync + _scratch_sync #$XFS_QUOTA_PROG -x -c 'report' $SCRATCH_MNT >> $seqres.full du_rep=$(du -ks $SCRATCH_MNT | awk '{print $1}') u_rep=$(report_quota_blocks -u) diff --git a/tests/xfs/511 b/tests/xfs/511 index b55c34b92..a942e92e3 100755 --- a/tests/xfs/511 +++ b/tests/xfs/511 @@ -33,7 +33,7 @@ _require_prjquota $SCRATCH_DEV # Create a directory to be project object, and create a file to take 64k space mkdir $SCRATCH_MNT/t -$XFS_IO_PROG -f -c "pwrite 0 65536" -c sync $SCRATCH_MNT/t/file >>$seqres.full +$XFS_IO_PROG -f -c "pwrite 0 65536" -c syncfs $SCRATCH_MNT/t/file >>$seqres.full quota_cmd="$XFS_QUOTA_PROG -x" $quota_cmd -c "project -s -p $SCRATCH_MNT/t 42" $SCRATCH_MNT >/dev/null 2>&1 diff --git a/tests/xfs/519 b/tests/xfs/519 index ac815f123..37a139c9e 100755 --- a/tests/xfs/519 +++ b/tests/xfs/519 @@ -28,7 +28,7 @@ $XFS_IO_PROG -f -c 'pwrite -S 0x59 0 1m -b 1m' $SCRATCH_MNT/c >> $seqres.full _cp_reflink $SCRATCH_MNT/a $SCRATCH_MNT/e _cp_reflink $SCRATCH_MNT/c $SCRATCH_MNT/d touch $SCRATCH_MNT/b -sync +_scratch_sync # Test that setting the reflink flag on the dest file forces the log echo "test reflink flag not set" diff --git a/tests/xfs/520 b/tests/xfs/520 index 3734d8746..2d80188b2 100755 --- a/tests/xfs/520 +++ b/tests/xfs/520 @@ -46,7 +46,7 @@ force_crafted_metadata() { if [ $mounted -ne 0 ]; then dd if=/dev/zero of=$SCRATCH_MNT/test bs=65536 count=1 >> \ $seqres.full 2>&1 - sync + _scratch_sync fi _dmesg_since_test_start | tac | sed -ne "0,\#${kmsg}#p" | tac | \ diff --git a/tests/xfs/541 b/tests/xfs/541 index 518373fa8..9be15d1f6 100755 --- a/tests/xfs/541 +++ b/tests/xfs/541 @@ -91,7 +91,7 @@ test $after_rtextsz_blocks -eq $new_rtextsz_blocks || \ # Create a new realtime file to prove that we can. echo moo > $SCRATCH_MNT/a -sync -f $SCRATCH_MNT +_scratch_sync $XFS_IO_PROG -c 'lsattr -v' $SCRATCH_MNT/a | \ cut -d ' ' -f 1 | \ grep -q realtime || \ diff --git a/tests/xfs/553 b/tests/xfs/553 index f4294e9c1..13ef629e3 100755 --- a/tests/xfs/553 +++ b/tests/xfs/553 @@ -45,7 +45,7 @@ $XFS_IO_PROG -c "cowextsize $((blksz * 4096))" $destination >> $seqres.full echo "Fragment FS" $XFS_IO_PROG -f -c "pwrite 0 $((blksz * 16384))" $fragmented_file \ >> $seqres.full -sync +_scratch_sync $here/src/punch-alternating $fragmented_file >> $seqres.full echo "Inject bmap_alloc_minlen_extent error tag" @@ -54,7 +54,7 @@ _scratch_inject_error bmap_alloc_minlen_extent 1 echo "Create delalloc extent of length 4096 blocks in destination file's CoW fork" $XFS_IO_PROG -c "pwrite 0 $blksz" $destination >> $seqres.full -sync +_scratch_sync echo "Direct I/O write at 3rd block in destination file" $XFS_IO_PROG -d -c "pwrite $((blksz * 3)) $((blksz * 2))" $destination \ diff --git a/tests/xfs/558 b/tests/xfs/558 index ec2fbcb68..ba137ae8d 100755 --- a/tests/xfs/558 +++ b/tests/xfs/558 @@ -140,13 +140,13 @@ $XFS_IO_PROG -c 'cowextsize 1m' $SCRATCH_MNT # Write out a file with the first two blocks unshared and the rest shared. _pwrite_byte 0x59 0 $((160 * blksz)) $SCRATCH_MNT/file >> $seqres.full _pwrite_byte 0x59 0 $((160 * blksz)) $SCRATCH_MNT/file.compare >> $seqres.full -sync +_scratch_sync _cp_reflink $SCRATCH_MNT/file $SCRATCH_MNT/file.reflink _pwrite_byte 0x58 0 $((2 * blksz)) $SCRATCH_MNT/file >> $seqres.full _pwrite_byte 0x58 0 $((2 * blksz)) $SCRATCH_MNT/file.compare >> $seqres.full -sync +_scratch_sync # Avoid creation of large folios on newer kernels by cycling the mount and # immediately writing to the page cache. @@ -156,7 +156,7 @@ _scratch_cycle_mount # before slowing down writeback to avoid unnecessary delay. _pwrite_byte 0x57 0 $((2 * blksz)) $SCRATCH_MNT/file.compare >> $seqres.full _pwrite_byte 0x56 $((2 * blksz)) $((2 * blksz)) $SCRATCH_MNT/file.compare >> $seqres.full -sync +_scratch_sync # Introduce a half-second wait to each writeback block mapping call. This # gives us a chance to race speculative cow prealloc with writeback. diff --git a/tests/xfs/607 b/tests/xfs/607 index 530fea9ed..ae1e19a9a 100755 --- a/tests/xfs/607 +++ b/tests/xfs/607 @@ -53,7 +53,7 @@ fi echo "Create source file" $XFS_IO_PROG -f -c "pwrite 0 $((blksz * 256))" $file1 >> $seqres.full -sync +_test_sync echo "Create Reflinked file" _cp_reflink $file1 $file2 >> $seqres.full @@ -63,7 +63,7 @@ $XFS_IO_PROG -c "cowextsize $((blksz * 128))" -c stat $file1 >> $seqres.full echo "Fragment FS" $XFS_IO_PROG -f -c "pwrite 0 $((blksz * 512))" $fragmentedfile >> $seqres.full -sync +_test_sync $here/src/punch-alternating $fragmentedfile echo "Allocate block sized extent from now onwards" @@ -72,7 +72,7 @@ _test_inject_error bmap_alloc_minlen_extent 1 echo "Create big delalloc extent in CoW fork" $XFS_IO_PROG -c "pwrite 0 $blksz" $file1 >> $seqres.full -sync +_test_sync $XFS_IO_PROG -c 'bmap -elpv' -c 'bmap -celpv' $file1 &>> $seqres.full diff --git a/tests/xfs/617 b/tests/xfs/617 index 2f5bf5233..e0ad7d816 100755 --- a/tests/xfs/617 +++ b/tests/xfs/617 @@ -35,7 +35,7 @@ swap_and_check_contents() { local b="$2" local tag="$3" - sync + _scratch_sync # Test exchangerange. -w means skip holes in /b echo "swap $tag" >> $seqres.full diff --git a/tests/xfs/629 b/tests/xfs/629 index 58beedc03..34b3ca0d6 100755 --- a/tests/xfs/629 +++ b/tests/xfs/629 @@ -55,7 +55,7 @@ for ((n=0; n /dev/null 2>&1 & done wait -sync +_scratch_sync for ((n=0; n /dev/null 2>&1 & done wait -sync +_scratch_sync for ((n=0; n /dev/null 2>&1 & done wait -sync +_scratch_sync for ((n=0; n> $seqres.full _pwrite_byte 0x59 0 $((blksz * nrblks)) $dir/c >> $seqres.full _pwrite_byte 0x58 0 $((blksz * nrblks)) $dir/a >> $seqres.full -sync +_test_sync # Inject a bmap error and trigger it via exchangerange. filesnap "before commit" diff --git a/tests/xfs/791 b/tests/xfs/791 index bca580420..0fcc48190 100755 --- a/tests/xfs/791 +++ b/tests/xfs/791 @@ -38,7 +38,7 @@ _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full $XFS_IO_PROG -f -c 'truncate 1m' $SCRATCH_MNT/b _pwrite_byte 0x59 64k 64k $SCRATCH_MNT/b >> $seqres.full _pwrite_byte 0x57 768k 64k $SCRATCH_MNT/b >> $seqres.full -sync +_scratch_sync md5sum $SCRATCH_MNT/a | _filter_scratch md5sum $SCRATCH_MNT/b | _filter_scratch diff --git a/tests/xfs/792 b/tests/xfs/792 index cdfa63692..6c7b2db11 100755 --- a/tests/xfs/792 +++ b/tests/xfs/792 @@ -33,7 +33,7 @@ _scratch_mount # Create original file _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full -sync +_scratch_sync md5sum $SCRATCH_MNT/a | _filter_scratch # Test atomic scatter-gather file commits. From patchwork Wed Nov 27 04:51:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886555 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FEC213D518 for ; Wed, 27 Nov 2024 04:54:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683257; cv=none; b=XRSKdLPtVID33Ontk8Zo7Wtv3y38nzGUJQkfZsmyIBg/OjpyzKFicgJE7fdogrGz1DwaUt3q0KJBgbIErY6G0Rixg6H28tbwK8aI0L8LBCqvoT9YoLR+SQFsAcwCxgmFymGHADGUEgZbgIKADxswMWdfKEN2/Pm+WLtZlrAW4ds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683257; c=relaxed/simple; bh=MinR9SLx2+HYuNc5PpG33kxYhJF+oCkH9ld9ubI3juY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gu2y/n2xytO8KB2GSboeHXkb/OyQoDPZ2Kh3AZq9CGOj836cFvZaiEV/A5sJoJp8+n6KvHO0wXFYk4uk+BNrbNAH5DVb67Iey1JikKcsLtWal40+D+hSzHzzF7JKYIDEDhlFMErXo6cfUHH6ODvJqSmCGym/SY5Tu0t93w5y3kQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=Nc6v0qAt; arc=none smtp.client-ip=209.85.210.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="Nc6v0qAt" Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-71d5fddef37so555438a34.0 for ; Tue, 26 Nov 2024 20:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683253; x=1733288053; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LlYOOQi3LBzeiPZZz70g4V5HovvqpPLZ362Jl1DFWzA=; b=Nc6v0qAtnwupNV8Jmy/Qio7KvFrJ9zU6uEbNk1PB+S/qc5q5itTC+h5D3vpAoHamLr 0KA61n0c2WpccqQFaJCgsqIwk5uTrRYYXY/2yycRL7fY6O4mkhG8dirhnMpULz6xYoHk 07RpotB/tshUv1uXNFiD0vP5xFTgnUjOO35s9PrTHjX2X3P7qkVrMklYrnxSX06exZfn VBQw927YFxzZxV3iLb+/y9VY/SE5yBvY0zGsQkVUsAi71LtMVWd3qxPzTMvbpdgsqOM6 oChLMGTRtWCscmDZ3a4ywUcn0wOiYuHd+N3uxOJW5mcKkxkoFq1Ww+Reaz2eWhGteLrZ csEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683253; x=1733288053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LlYOOQi3LBzeiPZZz70g4V5HovvqpPLZ362Jl1DFWzA=; b=ZjgNz2kRmM0XPlj/Gr8AjTAeOSwUKRS3JK7AtWhsKvEc+Gvef1G5Uvy079Um/oX0CY hkfyN62L949P1ih21BdQ2BD7nI4Pn+v2WvmI2pz3spMYr9goF/OHFeJYZYeCA7spCAD1 4oHNLMmlUimCdsNuyj4iCihcxFVDINzOvGY05GQXiBbdORc1LLRsAswpTlMKASNwfinZ 9GwjEmnKRFayb7jTBFdGNo/XsGEKIua0Oel9aUp2iOHf0EAG3FpxJsFrg1Hg+bK+Gt9b sroyu5YQ5LmEu1a85m83q//DlqthW6dGB675KlbWJGVOV0WqbmmVqaICOdvFHNu7eDO4 7L5Q== X-Gm-Message-State: AOJu0YwKvtUPCOjSUJU32rXKENWMkvRBVAXjoINn9+LnleAQfIlEBOBc q0npPlAUoFL8q5mhVpuXtWIm3VB+qAlcqQpJ608i8nxuuCGu789G0l7atvk8B7jzuAYGnHrp4aE 4 X-Gm-Gg: ASbGnct0yAv398SYlXdRRGOfyTbCq4Hzrb2ZQlPnqAWD5klYwhVmNEIgrjuoxr/kXFj NRZZnvIri3x2YHaUDXTyw/PHpmGVDt3DcQM5fT3GVY8GChTcD6YJCCUW2zh7bVdgVjtAjl/lgPR /iPyroDv/WEBGanjOozO1aO0JJkZyZpKrB58jQ7HC91wwqCKDlPIahNE/jebMXxyLOFcd9Z+YYS XQ4RQK5ri9lQeEfik9lKM6MtD139NYmNusueCaYAUKVnKd2cwrhoCugNPb+urq9mnZ4oDuWqaxj ao7tk1S+Hg27kVf1+GiwUStF X-Google-Smtp-Source: AGHT+IG1VK/YeKeN3dki9kcangs0uLLuFK9EZZwV0ON0DC/DH67II8w3fEwP3hMPMiqViJz1fEZ3fg== X-Received: by 2002:a05:6830:2655:b0:71d:572f:66c3 with SMTP id 46e09a7af769-71d65d0983dmr1598233a34.30.1732683253167; Tue, 26 Nov 2024 20:54:13 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fbcbfc3e26sm8297600a12.9.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:10 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZUa-0gEs for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQeO-19Mf for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 12/40] fstests: clean up mount and unmount operations Date: Wed, 27 Nov 2024 15:51:42 +1100 Message-ID: <20241127045403.3665299-13-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner The way tests run unmount is, at times, completely random. Sometimes they call the correct _scratch_unmount function, sometimes they open code it with a direct call to UMOUNT_PROG , sometimes they run umount directly. This makes it really hard to instrument unmount operations when trying to work out why transient, unpredictable failures like this occur randomly during a test run: umount: /mnt/xfs/runner-17/test: target is busy. Sometimes it happens on a test device mount, sometimes a scratch device mount. Sometimes it happens to a test specific dm or loop device mount. But without instrumenting every single unmount call in every test, it's impossible to capture these failures easily. Solve this problem by introducing the _unmount() wrapper. It is simply a call to UMOUNT_PROG , but it provides a single point were -every- unmount operation funnels through. We already have a _mount wrapper for this reason. However, in trying to work out why mounts were failing (because unmounts were failing), I discovered that that_mount() is used inconsistently as well. Sort this all out by adding and _unmount() wrapper to go with _mount() and use them everywhere consistently. Signed-off-by: Dave Chinner --- common/btrfs | 4 ++-- common/dmdelay | 4 ++-- common/dmdust | 4 ++-- common/dmerror | 4 ++-- common/dmflakey | 4 ++-- common/dmhugedisk | 2 +- common/dmlogwrites | 4 ++-- common/dmthin | 4 ++-- common/overlay | 10 +++++----- common/populate | 8 ++++---- common/rc | 42 +++++++++++++++++++++++++----------------- tests/generic/042 | 4 ++-- tests/generic/050 | 3 ++- tests/generic/067 | 6 +++--- tests/generic/081 | 2 +- tests/generic/085 | 6 +++--- tests/generic/108 | 2 +- tests/generic/171 | 2 +- tests/generic/172 | 2 +- tests/generic/173 | 2 +- tests/generic/174 | 2 +- tests/generic/306 | 2 +- tests/generic/332 | 2 +- tests/generic/361 | 2 +- tests/generic/373 | 2 +- tests/generic/374 | 2 +- tests/generic/395 | 2 +- tests/generic/459 | 2 +- tests/generic/563 | 10 +++++----- tests/generic/604 | 2 +- tests/generic/631 | 2 +- tests/generic/648 | 6 +++--- tests/generic/698 | 4 ++-- tests/generic/699 | 8 ++++---- tests/generic/704 | 2 +- tests/generic/717 | 2 +- tests/generic/730 | 2 +- tests/generic/731 | 2 +- tests/generic/732 | 4 ++-- tests/generic/741 | 2 +- tests/generic/744 | 6 +++--- tests/generic/746 | 8 ++++---- tests/xfs/014 | 6 +++--- tests/xfs/073 | 20 ++++++++++---------- tests/xfs/074 | 2 +- tests/xfs/078 | 6 +++--- tests/xfs/148 | 6 +++--- tests/xfs/149 | 4 ++-- tests/xfs/186 | 4 ++-- tests/xfs/216 | 10 ++++++++-- tests/xfs/217 | 4 ++-- tests/xfs/250 | 7 ++++--- tests/xfs/289 | 4 ++-- tests/xfs/507 | 2 +- tests/xfs/513 | 4 ++-- tests/xfs/544 | 2 +- tests/xfs/606 | 2 +- tests/xfs/613 | 4 ++-- 58 files changed, 149 insertions(+), 133 deletions(-) diff --git a/common/btrfs b/common/btrfs index 95a9c8e6c..4a2c9886e 100644 --- a/common/btrfs +++ b/common/btrfs @@ -352,7 +352,7 @@ _btrfs_stress_subvolume() while [ ! -e $stop_file ]; do $BTRFS_UTIL_PROG subvolume create $btrfs_mnt/$subvol_name $MOUNT_PROG -o subvol=$subvol_name $btrfs_dev $subvol_mnt - $UMOUNT_PROG $subvol_mnt + _unmount $subvol_mnt $BTRFS_UTIL_PROG subvolume delete $btrfs_mnt/$subvol_name done } @@ -368,7 +368,7 @@ _btrfs_kill_stress_subvolume_pid() # Ignore if process already died. wait $subvol_pid &> /dev/null rm -f $stop_file - $UMOUNT_PROG $subvol_mnt &> /dev/null + _unmount $subvol_mnt &> /dev/null } # stress btrfs by running scrub in a loop diff --git a/common/dmdelay b/common/dmdelay index 1c4fca6e9..848afb993 100644 --- a/common/dmdelay +++ b/common/dmdelay @@ -28,7 +28,7 @@ _mount_delay() _unmount_delay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } _cleanup_delay() @@ -36,7 +36,7 @@ _cleanup_delay() # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang $DMSETUP_PROG resume $DELAY_NAME > /dev/null 2>&1 - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _dmsetup_remove $DELAY_NAME } diff --git a/common/dmdust b/common/dmdust index 37bb865c8..55bbc84db 100644 --- a/common/dmdust +++ b/common/dmdust @@ -24,7 +24,7 @@ _mount_dust() _unmount_dust() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } _cleanup_dust() @@ -32,6 +32,6 @@ _cleanup_dust() # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang $DMSETUP_PROG resume $DUST_NAME > /dev/null 2>&1 - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _dmsetup_remove $DUST_NAME } diff --git a/common/dmerror b/common/dmerror index 97796b38e..309129c03 100644 --- a/common/dmerror +++ b/common/dmerror @@ -101,7 +101,7 @@ _dmerror_mount() _dmerror_unmount() { - umount $SCRATCH_MNT + _unmount $SCRATCH_MNT } _dmerror_cleanup() @@ -110,7 +110,7 @@ _dmerror_cleanup() test -n "$NON_ERROR_RTDEV" && $DMSETUP_PROG resume $DMERROR_RTNAME &>/dev/null $DMSETUP_PROG resume $DMERROR_NAME > /dev/null 2>&1 - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 test -n "$NON_ERROR_LOGDEV" && _dmsetup_remove $DMERROR_LOGNAME test -n "$NON_ERROR_RTDEV" && _dmsetup_remove $DMERROR_RTNAME diff --git a/common/dmflakey b/common/dmflakey index 75a0a67c8..7368a3e5b 100644 --- a/common/dmflakey +++ b/common/dmflakey @@ -71,7 +71,7 @@ _mount_flakey() _unmount_flakey() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } _cleanup_flakey() @@ -82,7 +82,7 @@ _cleanup_flakey() test -n "$NON_FLAKEY_RTDEV" && $DMSETUP_PROG resume $FLAKEY_RTNAME &> /dev/null $DMSETUP_PROG resume flakey-test > /dev/null 2>&1 - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _dmsetup_remove $FLAKEY_NAME test -n "$NON_FLAKEY_LOGDEV" && _dmsetup_remove $FLAKEY_LOGNAME diff --git a/common/dmhugedisk b/common/dmhugedisk index 0757e1908..2d23f436c 100644 --- a/common/dmhugedisk +++ b/common/dmhugedisk @@ -42,7 +42,7 @@ _dmhugedisk_init() _dmhugedisk_cleanup() { - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _dmsetup_remove $DMHUGE_TEST _dmsetup_remove $DMHUGE_TEST_ZERO } diff --git a/common/dmlogwrites b/common/dmlogwrites index c1c85de9d..a27e1966a 100644 --- a/common/dmlogwrites +++ b/common/dmlogwrites @@ -110,7 +110,7 @@ _log_writes_mount() _log_writes_unmount() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # _log_writes_replay_log @@ -141,7 +141,7 @@ _log_writes_remove() _log_writes_cleanup() { - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _log_writes_remove } diff --git a/common/dmthin b/common/dmthin index f2c00f5a7..453e43a04 100644 --- a/common/dmthin +++ b/common/dmthin @@ -23,7 +23,7 @@ DMTHIN_VOL_DEV="/dev/mapper/$DMTHIN_VOL_NAME" _dmthin_cleanup() { - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _dmsetup_remove $DMTHIN_VOL_NAME _dmsetup_remove $DMTHIN_POOL_NAME _dmsetup_remove $DMTHIN_META_NAME @@ -32,7 +32,7 @@ _dmthin_cleanup() _dmthin_check_fs() { - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _check_scratch_fs $DMTHIN_VOL_DEV } diff --git a/common/overlay b/common/overlay index faa9339a6..01b6622f5 100644 --- a/common/overlay +++ b/common/overlay @@ -142,18 +142,18 @@ _overlay_base_unmount() [ -n "$dev" -a -n "$mnt" ] || return 0 - $UMOUNT_PROG $mnt + _unmount $mnt } _overlay_test_unmount() { - $UMOUNT_PROG $TEST_DIR + _unmount $TEST_DIR _overlay_base_unmount "$OVL_BASE_TEST_DEV" "$OVL_BASE_TEST_DIR" } _overlay_scratch_unmount() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_base_unmount "$OVL_BASE_SCRATCH_DEV" "$OVL_BASE_SCRATCH_MNT" } @@ -342,7 +342,7 @@ _overlay_check_scratch_dirs() # Need to umount overlay for scratch dir check local ovl_mounted=`_is_dir_mountpoint $SCRATCH_MNT` - [ -z "$ovl_mounted" ] || $UMOUNT_PROG $SCRATCH_MNT + [ -z "$ovl_mounted" ] || _unmount $SCRATCH_MNT # Check dirs with extra overlay options _overlay_check_dirs $lowerdir $upperdir $workdir $* @@ -387,7 +387,7 @@ _overlay_check_fs() else # Check and umount overlay for dir check ovl_mounted=`_is_dir_mountpoint $ovl_mnt` - [ -z "$ovl_mounted" ] || $UMOUNT_PROG $ovl_mnt + [ -z "$ovl_mounted" ] || _unmount $ovl_mnt fi _overlay_check_dirs $base_mnt/$OVL_LOWER $base_mnt/$OVL_UPPER \ diff --git a/common/populate b/common/populate index 88c8ba2b3..4cf9c0691 100644 --- a/common/populate +++ b/common/populate @@ -517,7 +517,7 @@ _scratch_xfs_populate() { __populate_fragment_file "${SCRATCH_MNT}/RTRMAPBT" __populate_fragment_file "${SCRATCH_MNT}/REFCOUNTBT" - umount "${SCRATCH_MNT}" + _scratch_unmount } # Populate an ext4 on the scratch device with (we hope) all known @@ -619,7 +619,7 @@ _scratch_ext4_populate() { # Make sure we get all the fragmentation we asked for __populate_fragment_file "${SCRATCH_MNT}/S_IFREG.FMT_ETREE" - umount "${SCRATCH_MNT}" + _scratch_unmount } # Find the inode number of a file @@ -772,7 +772,7 @@ _scratch_xfs_populate_check() { dblksz="$(_xfs_get_dir_blocksize "$SCRATCH_MNT")" leaf_lblk="$((32 * 1073741824 / blksz))" node_lblk="$((64 * 1073741824 / blksz))" - umount "${SCRATCH_MNT}" + _scratch_unmount __populate_check_xfs_dformat "${extents_file}" "extents" __populate_check_xfs_dformat "${btree_file}" "btree" @@ -885,7 +885,7 @@ _scratch_ext4_populate_check() { extents_slink="$(__populate_find_inode "${SCRATCH_MNT}/S_IFLNK.FMT_EXTENTS")" local_attr="$(__populate_find_inode "${SCRATCH_MNT}/ATTR.FMT_LOCAL")" block_attr="$(__populate_find_inode "${SCRATCH_MNT}/ATTR.FMT_BLOCK")" - umount "${SCRATCH_MNT}" + _scratch_unmount __populate_check_ext4_dformat "${extents_file}" "extents" __populate_check_ext4_dformat "${etree_file}" "etree" diff --git a/common/rc b/common/rc index 6f939e3b5..3f35da7fe 100644 --- a/common/rc +++ b/common/rc @@ -301,7 +301,7 @@ _put_mount() local last_mnt=`echo $MOUNTED_POINT_STACK | awk '{print $1}'` if [ -n "$last_mnt" ]; then - $UMOUNT_PROG $last_mnt + _unmount $last_mnt fi MOUNTED_POINT_STACK=`echo $MOUNTED_POINT_STACK | cut -d\ -f2-` } @@ -310,7 +310,7 @@ _put_mount() _clear_mount_stack() { if [ -n "$MOUNTED_POINT_STACK" ]; then - $UMOUNT_PROG $MOUNTED_POINT_STACK + _unmount -R $MOUNTED_POINT_STACK fi MOUNTED_POINT_STACK="" } @@ -448,6 +448,14 @@ _scratch_mount_idmapped() fi } +# Unmount the filesystem based on the directory or device passed. +_unmount() +{ + local args="$*" + + $UMOUNT_PROG $args >> $seqres.full 2>&1 +} + _scratch_unmount() { case "$FSTYP" in @@ -455,20 +463,20 @@ _scratch_unmount() _overlay_scratch_unmount ;; btrfs) - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT ;; tmpfs) - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT ;; *) - $UMOUNT_PROG $SCRATCH_DEV + _unmount $SCRATCH_DEV ;; esac } _scratch_umount_idmapped() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } _scratch_remount() @@ -492,7 +500,7 @@ _scratch_cycle_mount() ;; overlay) if [ "$OVL_BASE_FSTYP" = tmpfs ]; then - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT unmounted=true fi ;; @@ -540,9 +548,9 @@ _move_mount() # Replace $mnt with $tmp. Use a temporary bind-mount because # mount --move will fail with certain mount propagation layouts. - $UMOUNT_PROG $mnt || _fail "Failed to unmount $mnt" + _unmount $mnt || _fail "Failed to unmount $mnt" _mount --bind $tmp $mnt || _fail "Failed to bind-mount $tmp to $mnt" - $UMOUNT_PROG $tmp || _fail "Failed to unmount $tmp" + _unmount $tmp || _fail "Failed to unmount $tmp" rmdir $tmp } @@ -608,7 +616,7 @@ _test_unmount() if [ "$FSTYP" == "overlay" ]; then _overlay_test_unmount else - $UMOUNT_PROG $TEST_DEV + _unmount $TEST_DEV fi } @@ -622,7 +630,7 @@ _test_cycle_mount() ;; overlay) if [ "$OVL_BASE_FSTYP" = tmpfs ]; then - $UMOUNT_PROG $TEST_DIR + _unmount $TEST_DIR unmounted=true fi ;; @@ -1376,7 +1384,7 @@ _repair_scratch_fs() _scratch_xfs_repair -L 2>&1 echo "log zap returns $?" else - umount "$SCRATCH_MNT" + _unmount "$SCRATCH_MNT" fi _scratch_xfs_repair "$@" 2>&1 res=$? @@ -1408,7 +1416,7 @@ _repair_scratch_fs() # Fall through to repair base fs dev=$OVL_BASE_SCRATCH_DEV fstyp=$OVL_BASE_FSTYP - $UMOUNT_PROG $OVL_BASE_SCRATCH_MNT + _unmount $OVL_BASE_SCRATCH_MNT fi # Let's hope fsck -y suffices... fsck -t $fstyp -y $dev 2>&1 @@ -1441,7 +1449,7 @@ _repair_test_fs() _test_xfs_repair -L >>$tmp.repair 2>&1 echo "log zap returns $?" >> $tmp.repair else - umount "$TEST_DEV" + _unmount "$TEST_DEV" fi _test_xfs_repair "$@" >>$tmp.repair 2>&1 res=$? @@ -2222,7 +2230,7 @@ _require_logdev() _notrun "This test requires USE_EXTERNAL to be enabled" # ensure its not mounted - $UMOUNT_PROG $SCRATCH_LOGDEV 2>/dev/null + _unmount $SCRATCH_LOGDEV 2>/dev/null } # This test requires that an external log device is not in use @@ -3309,7 +3317,7 @@ _umount_or_remount_ro() local mountpoint=`_is_dev_mounted $device` if [ $USE_REMOUNT -eq 0 ]; then - $UMOUNT_PROG $device + _unmount $device else _remount $device ro fi @@ -3826,7 +3834,7 @@ _require_scratch_dev_pool() _notrun "$i is part of TEST_DEV, this test requires unique disks" fi if _mount | grep -q $i; then - if ! $UMOUNT_PROG $i; then + if ! _unmount $i; then echo "failed to unmount $i - aborting" exit 1 fi diff --git a/tests/generic/042 b/tests/generic/042 index fd0ef705a..ced145dde 100755 --- a/tests/generic/042 +++ b/tests/generic/042 @@ -44,7 +44,7 @@ _crashtest() _filter_xfs_io $here/src/godown -f $mnt - $UMOUNT_PROG $mnt + _unmount $mnt _mount $img $mnt # We should /never/ see 0xCD in the file, because we wrote that pattern @@ -54,7 +54,7 @@ _crashtest() _hexdump $file fi - $UMOUNT_PROG $mnt + _unmount $mnt } # Modify as appropriate. diff --git a/tests/generic/050 b/tests/generic/050 index ca02d3092..8e9456db2 100755 --- a/tests/generic/050 +++ b/tests/generic/050 @@ -87,8 +87,9 @@ blockdev --setro $SCRATCH_DEV echo "mounting filesystem that needs recovery on a read-only device:" _try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch +# expects an error, so open code the unmount echo "unmounting read-only filesystem" -_scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot +$UMOUNT_PROG $SCRATCH_DEV 2>&1 | _filter_scratch | _filter_ending_dot # # This is the way out if the underlying device really is read-only. diff --git a/tests/generic/067 b/tests/generic/067 index b561b7bc5..ccb1e3fbb 100755 --- a/tests/generic/067 +++ b/tests/generic/067 @@ -66,7 +66,7 @@ umount_symlink_device() rm -f $symlink echo "# umount symlink to device, which is not mounted" >>$seqres.full ln -s $SCRATCH_DEV $symlink - $UMOUNT_PROG $symlink >>$seqres.full 2>&1 + _unmount $symlink >>$seqres.full 2>&1 } # umount a path name that is 256 bytes long, this should fail gracefully, @@ -78,7 +78,7 @@ umount_toolong_name() _scratch_mount 2>&1 | tee -a $seqres.full echo "# umount a too-long name" >>$seqres.full - $UMOUNT_PROG $longname >>$seqres.full 2>&1 + _unmount $longname >>$seqres.full 2>&1 _scratch_unmount 2>&1 | tee -a $seqres.full } @@ -93,7 +93,7 @@ lazy_umount_symlink() rm -f $symlink ln -s $SCRATCH_MNT/testdir $symlink - $UMOUNT_PROG -l $symlink >>$seqres.full 2>&1 + _unmount -l $symlink >>$seqres.full 2>&1 # _scratch_unmount should not be blocked _scratch_unmount 2>&1 | tee -a $seqres.full } diff --git a/tests/generic/081 b/tests/generic/081 index 468c87ac9..df17ab6c1 100755 --- a/tests/generic/081 +++ b/tests/generic/081 @@ -32,7 +32,7 @@ _cleanup() # other tests to fail. while test -e /dev/mapper/$vgname-$snapname || \ test -e /dev/mapper/$vgname-$lvname; do - $UMOUNT_PROG $mnt >> $seqres.full 2>&1 + _unmount $mnt >> $seqres.full 2>&1 $LVM_PROG lvremove -f $vgname/$snapname >>$seqres.full 2>&1 $LVM_PROG lvremove -f $vgname/$lvname >>$seqres.full 2>&1 $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1 diff --git a/tests/generic/085 b/tests/generic/085 index cfe6112d6..8fbcdce2e 100755 --- a/tests/generic/085 +++ b/tests/generic/085 @@ -27,7 +27,7 @@ cleanup_dmdev() $DMSETUP_PROG resume $lvdev >/dev/null 2>&1 [ -n "$pid" ] && kill -9 $pid 2>/dev/null wait $pid - $UMOUNT_PROG $lvdev >/dev/null 2>&1 + _unmount $lvdev >/dev/null 2>&1 _dmsetup_remove $node } @@ -69,8 +69,8 @@ for ((i=0; i<100; i++)); do done & pid=$! for ((i=0; i<100; i++)); do - $MOUNT_PROG $lvdev $SCRATCH_MNT >/dev/null 2>&1 - $UMOUNT_PROG $lvdev >/dev/null 2>&1 + _mount $lvdev $SCRATCH_MNT >/dev/null 2>&1 + _unmount $lvdev >/dev/null 2>&1 done & pid="$pid $!" diff --git a/tests/generic/108 b/tests/generic/108 index da13715f2..2709472f6 100755 --- a/tests/generic/108 +++ b/tests/generic/108 @@ -18,7 +18,7 @@ _cleanup() { cd / echo running > /sys/block/`_short_dev $SCSI_DEBUG_DEV`/device/state - $UMOUNT_PROG $SCRATCH_MNT >>$seqres.full 2>&1 + _unmount $SCRATCH_MNT >>$seqres.full 2>&1 $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1 $LVM_PROG pvremove -f $SCRATCH_DEV $SCSI_DEBUG_DEV >>$seqres.full 2>&1 $UDEV_SETTLE_PROG diff --git a/tests/generic/171 b/tests/generic/171 index 5c8504d26..8726ee61d 100755 --- a/tests/generic/171 +++ b/tests/generic/171 @@ -36,7 +36,7 @@ mkdir $testdir echo "Reformat with appropriate size" blksz="$(_get_block_size $testdir)" nr_blks=10240 -umount $SCRATCH_MNT +_scratch_unmount sz_bytes=$((nr_blks * 8 * blksz)) if [ $sz_bytes -lt $((32 * 1048576)) ]; then sz_bytes=$((32 * 1048576)) diff --git a/tests/generic/172 b/tests/generic/172 index 17f817805..b67e817b6 100755 --- a/tests/generic/172 +++ b/tests/generic/172 @@ -35,7 +35,7 @@ mkdir $testdir echo "Reformat with appropriate size" blksz="$(_get_block_size $testdir)" -umount $SCRATCH_MNT +_scratch_unmount file_size=$((768 * 1024 * 1024)) fs_size=$((1024 * 1024 * 1024)) diff --git a/tests/generic/173 b/tests/generic/173 index d7ac7b15d..a19ff8070 100755 --- a/tests/generic/173 +++ b/tests/generic/173 @@ -36,7 +36,7 @@ mkdir $testdir echo "Reformat with appropriate size" blksz="$(_get_block_size $testdir)" nr_blks=10240 -umount $SCRATCH_MNT +_scratch_unmount sz_bytes=$((nr_blks * 8 * blksz)) if [ $sz_bytes -lt $((32 * 1048576)) ]; then sz_bytes=$((32 * 1048576)) diff --git a/tests/generic/174 b/tests/generic/174 index c7c62001d..32343d911 100755 --- a/tests/generic/174 +++ b/tests/generic/174 @@ -37,7 +37,7 @@ mkdir $testdir echo "Reformat with appropriate size" blksz="$(_get_block_size $testdir)" nr_blks=10240 -umount $SCRATCH_MNT +_scratch_unmount sz_bytes=$((nr_blks * 8 * blksz)) if [ $sz_bytes -lt $((32 * 1048576)) ]; then sz_bytes=$((32 * 1048576)) diff --git a/tests/generic/306 b/tests/generic/306 index a6ea654b6..8e118472d 100755 --- a/tests/generic/306 +++ b/tests/generic/306 @@ -12,7 +12,7 @@ _begin_fstest auto quick rw # Override the default cleanup function. _cleanup() { - umount $BINDFILE + _unmount $BINDFILE cd / rm -f $tmp.* } diff --git a/tests/generic/332 b/tests/generic/332 index cb15e77bd..fef4eabb8 100755 --- a/tests/generic/332 +++ b/tests/generic/332 @@ -61,7 +61,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "Check for damage" -umount $SCRATCH_MNT +_scratch_unmount _repair_scratch_fs >> $seqres.full # success, all done diff --git a/tests/generic/361 b/tests/generic/361 index c56157391..7273dd056 100755 --- a/tests/generic/361 +++ b/tests/generic/361 @@ -16,7 +16,7 @@ _begin_fstest auto quick # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $fs_mnt + _unmount $fs_mnt _destroy_loop_device $loop_dev cd / rm -f $tmp.* diff --git a/tests/generic/373 b/tests/generic/373 index 3bd46963a..e6334398f 100755 --- a/tests/generic/373 +++ b/tests/generic/373 @@ -60,7 +60,7 @@ md5sum $testdir/file | _filter_scratch md5sum $othertestdir/otherfile | filter_otherdir echo "Unmount otherdir" -$UMOUNT_PROG $otherdir +_unmount $otherdir rm -rf $otherdir # success, all done diff --git a/tests/generic/374 b/tests/generic/374 index acb23d172..e56521aa0 100755 --- a/tests/generic/374 +++ b/tests/generic/374 @@ -59,7 +59,7 @@ echo "Check output" md5sum $testdir/file $othertestdir/otherfile | filter_md5 echo "Unmount otherdir" -$UMOUNT_PROG $otherdir +_unmount $otherdir rm -rf $otherdir # success, all done diff --git a/tests/generic/395 b/tests/generic/395 index 45787fff0..f9c331adb 100755 --- a/tests/generic/395 +++ b/tests/generic/395 @@ -75,7 +75,7 @@ mount --bind $SCRATCH_MNT $SCRATCH_MNT/ro_bind_mnt mount -o remount,ro,bind $SCRATCH_MNT/ro_bind_mnt _set_encpolicy $SCRATCH_MNT/ro_bind_mnt/ro_dir |& _filter_scratch _get_encpolicy $SCRATCH_MNT/ro_bind_mnt/ro_dir |& _filter_scratch -umount $SCRATCH_MNT/ro_bind_mnt +_unmount $SCRATCH_MNT/ro_bind_mnt # success, all done status=0 diff --git a/tests/generic/459 b/tests/generic/459 index 98177f6b5..daccc80ce 100755 --- a/tests/generic/459 +++ b/tests/generic/459 @@ -28,7 +28,7 @@ _cleanup() xfs_freeze -u $SCRATCH_MNT 2>/dev/null cd / rm -f $tmp.* - $UMOUNT_PROG $SCRATCH_MNT >>$seqres.full 2>&1 + _unmount $SCRATCH_MNT >>$seqres.full 2>&1 $LVM_PROG vgremove -ff $vgname >>$seqres.full 2>&1 $LVM_PROG pvremove -ff $SCRATCH_DEV >>$seqres.full 2>&1 $UDEV_SETTLE_PROG diff --git a/tests/generic/563 b/tests/generic/563 index e8db8acf0..f0d2f404c 100755 --- a/tests/generic/563 +++ b/tests/generic/563 @@ -16,13 +16,13 @@ _begin_fstest auto quick # Override the default cleanup function. _cleanup() { + echo $$ > $cgdir/cgroup.procs + rmdir $cgdir/$seq-cg* > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 + _destroy_loop_device $LOOP_DEV > /dev/null 2>&1 cd / rm -f $tmp.* - echo $$ > $cgdir/cgroup.procs - rmdir $cgdir/$seq-cg* > /dev/null 2>&1 - umount $SCRATCH_MNT > /dev/null 2>&1 - _destroy_loop_device $LOOP_DEV > /dev/null 2>&1 } # Import common functions. @@ -80,7 +80,7 @@ reset() rmdir $cgdir/$seq-cg* > /dev/null 2>&1 $XFS_IO_PROG -fc "pwrite 0 $iosize" $SCRATCH_MNT/file \ >> $seqres.full 2>&1 - umount $SCRATCH_MNT || _fail "umount failed" + _unmount $SCRATCH_MNT || _fail "umount failed" _mount $LOOP_DEV $SCRATCH_MNT || _fail "mount failed" stat $SCRATCH_MNT/file > /dev/null } diff --git a/tests/generic/604 b/tests/generic/604 index c2e03c2ea..744d34565 100755 --- a/tests/generic/604 +++ b/tests/generic/604 @@ -26,7 +26,7 @@ done # mount the base fs. Delay the mount attempt by a small amount in the hope # that the mount() call will try to lock s_umount /after/ umount has already # taken it. -$UMOUNT_PROG $SCRATCH_MNT & +_unmount $SCRATCH_MNT & sleep 0.01s ; _scratch_mount wait diff --git a/tests/generic/631 b/tests/generic/631 index c7c95e560..642d47863 100755 --- a/tests/generic/631 +++ b/tests/generic/631 @@ -84,7 +84,7 @@ worker() { touch $mergedir/etc/access.conf mv $mergedir/etc/access.conf $mergedir/etc/access.conf.bak touch $mergedir/etc/access.conf - umount $mergedir + _unmount $mergedir done rm -f $SCRATCH_MNT/workers/$tag } diff --git a/tests/generic/648 b/tests/generic/648 index e4c9990e1..7473c9d33 100755 --- a/tests/generic/648 +++ b/tests/generic/648 @@ -18,7 +18,7 @@ _cleanup() { _kill_fsstress if [ -n "$loopmnt" ]; then - $UMOUNT_PROG $loopmnt 2>/dev/null + _unmount $loopmnt 2>/dev/null rm -r -f $loopmnt fi _dmerror_unmount @@ -102,7 +102,7 @@ while _soak_loop_running $((25 * TIME_FACTOR)); do # Mount again to replay log after loading working table, so we have a # consistent fs after test. - $UMOUNT_PROG $loopmnt + _unmount $loopmnt is_unmounted=1 # We must unmount dmerror at here, or whole later testing will crash. # So try to umount enough times, before we have no choice. @@ -128,7 +128,7 @@ done # Make sure the fs image file is ok if [ -f "$loopimg" ]; then if _mount $loopimg $loopmnt -o loop; then - $UMOUNT_PROG $loopmnt &> /dev/null + _unmount $loopmnt &> /dev/null else _metadump_dev $DMERROR_DEV $seqres.scratch.final.md echo "final scratch mount failed" diff --git a/tests/generic/698 b/tests/generic/698 index 28928b2fb..0029df90f 100755 --- a/tests/generic/698 +++ b/tests/generic/698 @@ -17,8 +17,8 @@ _begin_fstest auto quick perms attr idmapped mount _cleanup() { cd / - $UMOUNT_PROG $SCRATCH_MNT/target-mnt 2>/dev/null - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT/target-mnt 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null rm -r -f $tmp.* } diff --git a/tests/generic/699 b/tests/generic/699 index 677307538..3079a861d 100755 --- a/tests/generic/699 +++ b/tests/generic/699 @@ -15,9 +15,9 @@ _begin_fstest auto quick perms attr idmapped mount _cleanup() { cd / - $UMOUNT_PROG $SCRATCH_MNT/target-mnt - $UMOUNT_PROG $SCRATCH_MNT/ovl-merge 2>/dev/null - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT/target-mnt + _unmount $SCRATCH_MNT/ovl-merge 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null rm -r -f $tmp.* } @@ -113,7 +113,7 @@ setup_overlayfs_idmapped_lower_metacopy_on() reset_overlayfs() { - $UMOUNT_PROG $SCRATCH_MNT/ovl-merge 2>/dev/null + _unmount $SCRATCH_MNT/ovl-merge 2>/dev/null rm -rf $upper $work $merge } diff --git a/tests/generic/704 b/tests/generic/704 index f39d47066..f452f9e9c 100755 --- a/tests/generic/704 +++ b/tests/generic/704 @@ -14,7 +14,7 @@ _cleanup() { cd / rm -r -f $tmp.* - [ -d "$SCSI_DEBUG_MNT" ] && $UMOUNT_PROG $SCSI_DEBUG_MNT 2>/dev/null + [ -d "$SCSI_DEBUG_MNT" ] && _unmount $SCSI_DEBUG_MNT 2>/dev/null _put_scsi_debug_dev } diff --git a/tests/generic/717 b/tests/generic/717 index 4378e964a..2ecd2888d 100755 --- a/tests/generic/717 +++ b/tests/generic/717 @@ -85,7 +85,7 @@ mkdir -p $SCRATCH_MNT/xyz mount --bind $dir $SCRATCH_MNT/xyz --bind _pwrite_byte 0x60 0 $((blksz * (nrblks + 2))) $dir/c >> $seqres.full $XFS_IO_PROG -c "exchangerange $SCRATCH_MNT/xyz/c" $dir/a -umount $SCRATCH_MNT/xyz +_unmount $SCRATCH_MNT/xyz echo Swapping a file with itself $XFS_IO_PROG -c "exchangerange $dir/a" $dir/a diff --git a/tests/generic/730 b/tests/generic/730 index 062314ea0..6251980e3 100755 --- a/tests/generic/730 +++ b/tests/generic/730 @@ -12,7 +12,7 @@ _begin_fstest auto quick _cleanup() { cd / - $UMOUNT_PROG $SCSI_DEBUG_MNT >>$seqres.full 2>&1 + _unmount $SCSI_DEBUG_MNT >>$seqres.full 2>&1 _put_scsi_debug_dev rm -f $tmp.* } diff --git a/tests/generic/731 b/tests/generic/731 index cd39e8b09..4ac5e1a3e 100755 --- a/tests/generic/731 +++ b/tests/generic/731 @@ -13,7 +13,7 @@ _begin_fstest auto quick _cleanup() { cd / - $UMOUNT_PROG $SCSI_DEBUG_MNT >>$seqres.full 2>&1 + _unmount $SCSI_DEBUG_MNT >>$seqres.full 2>&1 _put_scsi_debug_dev rm -f $tmp.* } diff --git a/tests/generic/732 b/tests/generic/732 index d08028c23..e907a009f 100755 --- a/tests/generic/732 +++ b/tests/generic/732 @@ -15,8 +15,8 @@ _begin_fstest auto quick rename # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $testdir1 2>/dev/null - $UMOUNT_PROG $testdir2 2>/dev/null + _unmount $testdir1 2>/dev/null + _unmount $testdir2 2>/dev/null cd / rm -r -f $tmp.* } diff --git a/tests/generic/741 b/tests/generic/741 index 4b480b5a1..cac7045eb 100755 --- a/tests/generic/741 +++ b/tests/generic/741 @@ -13,7 +13,7 @@ _begin_fstest auto quick volume tempfsid # Override the default cleanup function. _cleanup() { - umount $extra_mnt &> /dev/null + _unmount $extra_mnt &> /dev/null rm -rf $extra_mnt _unmount_flakey _cleanup_flakey diff --git a/tests/generic/744 b/tests/generic/744 index a31d8d7a4..df8f6ae9b 100755 --- a/tests/generic/744 +++ b/tests/generic/744 @@ -15,8 +15,8 @@ _cleanup() cd / rm -r -f $tmp.* - $UMOUNT_PROG $mnt2 &> /dev/null - $UMOUNT_PROG $mnt1 &> /dev/null + _unmount $mnt2 &> /dev/null + _unmount $mnt1 &> /dev/null [ -b "$loop_dev2" ] && losetup -d $loop_dev2 [ -b "$loop_dev1" ] && losetup -d $loop_dev1 [ -n "$seq" ] && rm -rf $TEST_DIR/$seq @@ -42,7 +42,7 @@ clone_filesystem() _mount $dev1 $mnt1 $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' $mnt1/foo >> $seqres.full - $UMOUNT_PROG $mnt1 + _unmount $mnt1 # device dump of $dev1 to $dev2 dd if=$dev1 of=$dev2 conv=fsync status=none || _fail "dd failed: $?" diff --git a/tests/generic/746 b/tests/generic/746 index 5734f254d..671910606 100755 --- a/tests/generic/746 +++ b/tests/generic/746 @@ -38,7 +38,7 @@ esac # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $loop_dev &> /dev/null + _unmount $loop_mnt &> /dev/null _destroy_loop_device $loop_dev if [ $status -eq 0 ]; then rm -rf $tmp @@ -53,7 +53,7 @@ get_holes() # in-core state that will perturb the free space map on umount. Stick # to established convention which requires the filesystem to be # unmounted while we probe the underlying file. - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt # FIEMAP only works on regular files, so call it on the backing file # and not the loop device like everything else @@ -66,7 +66,7 @@ get_free_sectors() { case $FSTYP in ext4) - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt $DUMPE2FS_PROG $loop_dev 2>&1 | grep " Free blocks" | cut -d ":" -f2- | \ tr ',' '\n' | $SED_PROG 's/^ //' | \ $AWK_PROG -v spb=$sectors_per_block 'BEGIN{FS="-"}; @@ -80,7 +80,7 @@ get_free_sectors() xfs) agsize=`$XFS_INFO_PROG $loop_mnt | $SED_PROG -n 's/.*agsize=\(.*\) blks.*/\1/p'` # Convert free space (agno, block, length) to (start sector, end sector) - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt $XFS_DB_PROG -r -c "freesp -d" $loop_dev | $SED_PROG '/^.*from/,$d'| \ $AWK_PROG -v spb=$sectors_per_block -v agsize=$agsize \ '{ print spb * ($1 * agsize + $2), spb * ($1 * agsize + $2 + $3) - 1 }' diff --git a/tests/xfs/014 b/tests/xfs/014 index 098f64186..f638e4b16 100755 --- a/tests/xfs/014 +++ b/tests/xfs/014 @@ -22,7 +22,7 @@ _begin_fstest auto enospc quick quota prealloc _cleanup() { cd / - umount $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null _scratch_unmount 2>/dev/null rm -f $tmp.* } @@ -168,13 +168,13 @@ LOOP_MNT=$SCRATCH_MNT/$seq.mnt $MKFS_XFS_PROG -d "file=1,name=$LOOP_FILE,size=10g" >> $seqres.full 2>&1 mkdir -p $LOOP_MNT -mount -t xfs -o loop,uquota,gquota $LOOP_FILE $LOOP_MNT || \ +_mount -o uquota,gquota $LOOP_FILE $LOOP_MNT || \ _fail "Failed to mount loop fs." _test_enospc $LOOP_MNT _test_edquot $LOOP_MNT -umount $LOOP_MNT +_unmount $LOOP_MNT echo $orig_sp_time > /proc/sys/fs/xfs/speculative_prealloc_lifetime diff --git a/tests/xfs/073 b/tests/xfs/073 index 28f1fad08..e4b17c5e7 100755 --- a/tests/xfs/073 +++ b/tests/xfs/073 @@ -21,9 +21,9 @@ _cleanup() { cd / _scratch_unmount 2>/dev/null - umount $imgs.loop 2>/dev/null + _unmount $imgs.loop 2>/dev/null + _unmount $imgs.source_dir 2>/dev/null [ -d $imgs.loop ] && rmdir $imgs.loop - umount $imgs.source_dir 2>/dev/null [ -d $imgs.source_dir ] && rm -rf $imgs.source_dir rm -f $imgs.* $tmp.* /var/tmp/xfs_copy.log.* } @@ -65,10 +65,10 @@ _verify_copy() rmdir $target_dir 2>/dev/null mkdir $target_dir - mount -t xfs -o loop $target $target_dir 2>/dev/null + _mount -t xfs -o loop $target $target_dir 2>/dev/null if [ $? -ne 0 ]; then echo retrying mount with nouuid option >>$seqres.full - mount -t xfs -o loop -o nouuid $target $target_dir + _mount -t xfs -o loop -o nouuid $target $target_dir if [ $? -ne 0 ]; then echo mount failed - evil! return @@ -87,19 +87,19 @@ _verify_copy() echo comparing new image geometry to old $XFS_INFO_PROG $source_dir \ - | _filter_copy $source $source_dir '/dev/loop.' '#' \ + | _filter_copy $source $source_dir '/dev/loop[0-9]\+' '#' \ | tr -s ' ' \ > $tmp.geometry1 $XFS_INFO_PROG $target_dir \ - | _filter_copy $target $target_dir '/dev/loop.' '#' \ + | _filter_copy $target $target_dir '/dev/loop[0-9]\+' '#' \ | tr -s ' ' \ > $tmp.geometry2 [ -s $tmp.geometry1 ] || echo no geometry output diff -u $tmp.geometry1 $tmp.geometry2 echo unmounting and removing new image - umount $source_dir - umount $target_dir > /dev/null 2>&1 + _unmount $source_dir + _unmount $target_dir > /dev/null 2>&1 rm -f $target } @@ -134,10 +134,10 @@ ${MKFS_XFS_PROG} -dfile,name=$imgs.source,size=100g \ rmdir $imgs.source_dir 2>/dev/null mkdir $imgs.source_dir -mount -t xfs -o loop $imgs.source $imgs.source_dir +_mount -t xfs -o loop $imgs.source $imgs.source_dir loop2=`mount | grep $imgs.source | grep -o -e 'loop=.*[^),]' | grep -o -e '/.*$'` cp -a $here $imgs.source_dir -mount -t xfs -o remount,ro $imgs.source $imgs.source_dir +_mount -t xfs -o remount,ro $imgs.source $imgs.source_dir $XFS_COPY_PROG $imgs.source $imgs.image | _filter_copy '#' $imgs.image '#' '#' _verify_copy $imgs.image $imgs.source $imgs.source_dir diff --git a/tests/xfs/074 b/tests/xfs/074 index 278f0ade6..6a03c8111 100755 --- a/tests/xfs/074 +++ b/tests/xfs/074 @@ -72,7 +72,7 @@ $XFS_IO_PROG -ft \ -c "falloc 1023m 2g" \ $LOOP_MNT/foo >> $seqres.full -umount $LOOP_MNT +_unmount $LOOP_MNT _check_xfs_filesystem $LOOP_DEV none none # success, all done diff --git a/tests/xfs/078 b/tests/xfs/078 index 834c99a00..6b325e05f 100755 --- a/tests/xfs/078 +++ b/tests/xfs/078 @@ -16,7 +16,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null [ -n "$LOOP_DEV" ] && _destroy_loop_device $LOOP_DEV 2>/dev/null # try to keep the image file if test fails [ $status -eq 0 ] && rm -f $LOOP_IMG @@ -75,13 +75,13 @@ _grow_loop() $XFS_IO_PROG -c "pwrite $new_size $bsize" $LOOP_IMG | _filter_io LOOP_DEV=`_create_loop_device $LOOP_IMG` echo "*** mount loop filesystem" - $MOUNT_PROG -t xfs $LOOP_DEV $LOOP_MNT + _mount -t xfs $LOOP_DEV $LOOP_MNT echo "*** grow loop filesystem" $XFS_GROWFS_PROG $LOOP_MNT 2>&1 | _filter_growfs 2>&1 echo "*** unmount" - $UMOUNT_PROG -d $LOOP_MNT && LOOP_DEV= + _unmount $LOOP_MNT # Large grows takes forever to check.. if [ "$check" -gt "0" ] diff --git a/tests/xfs/148 b/tests/xfs/148 index 9e6798f99..c42c9b119 100755 --- a/tests/xfs/148 +++ b/tests/xfs/148 @@ -14,7 +14,7 @@ _begin_fstest auto quick fuzzers _cleanup() { cd / - $UMOUNT_PROG $mntpt > /dev/null 2>&1 + _unmount $mntpt > /dev/null 2>&1 _destroy_loop_device $loopdev > /dev/null 2>&1 rm -r -f $tmp.* } @@ -90,7 +90,7 @@ cat $tmp.log >> $seqres.full cat $tmp.log | _filter_test_dir # Corrupt the entries -$UMOUNT_PROG $mntpt +_unmount $mntpt _destroy_loop_device $loopdev cp $imgfile $imgfile.old sed -b \ @@ -121,7 +121,7 @@ fi echo "does repair complain?" >> $seqres.full # Does repair complain about this? -$UMOUNT_PROG $mntpt +_unmount $mntpt $XFS_REPAIR_PROG -n $loopdev >> $seqres.full 2>&1 res=$? test $res -eq 1 || \ diff --git a/tests/xfs/149 b/tests/xfs/149 index f1b2405e7..f2187109b 100755 --- a/tests/xfs/149 +++ b/tests/xfs/149 @@ -22,7 +22,7 @@ loop_symlink=$TEST_DIR/loop_symlink.$$ # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $mntdir + _unmount $mntdir [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev rmdir $mntdir rm -f $loop_symlink @@ -73,7 +73,7 @@ echo "=== xfs_growfs - check device symlink ===" $XFS_GROWFS_PROG -D 12288 $loop_symlink > /dev/null echo "=== unmount ===" -$UMOUNT_PROG $mntdir || _fail "!!! failed to unmount" +_unmount $mntdir || _fail "!!! failed to unmount" echo "=== mount device symlink ===" $MOUNT_PROG $loop_symlink $mntdir || _fail "!!! failed to loopback mount" diff --git a/tests/xfs/186 b/tests/xfs/186 index 88f02585e..6f82e0cda 100755 --- a/tests/xfs/186 +++ b/tests/xfs/186 @@ -87,7 +87,7 @@ _do_eas() _create_eas $2 $3 fi echo "" - cd /; $UMOUNT_PROG $SCRATCH_MNT + cd /; _unmount $SCRATCH_MNT _print_inode } @@ -99,7 +99,7 @@ _do_dirents() echo "" _scratch_mount _create_dirents $1 $2 - cd /; $UMOUNT_PROG $SCRATCH_MNT + cd /; _unmount $SCRATCH_MNT _print_inode } diff --git a/tests/xfs/216 b/tests/xfs/216 index 680239b4e..6b8b2eb22 100755 --- a/tests/xfs/216 +++ b/tests/xfs/216 @@ -12,6 +12,12 @@ _begin_fstest log metadata auto quick # Import common functions. . ./common/filter +_cleanup() +{ + _unmount $LOOP_MNT > /dev/null 2>&1 + cd / + rm -f $tmp.* +} _require_scratch _scratch_mkfs_xfs >/dev/null 2>&1 @@ -50,9 +56,9 @@ _do_mkfs() echo -n "fssize=${i}g " $MKFS_XFS_PROG -f -b size=4096 -l version=2 \ -d name=$LOOP_DEV,size=${i}g $loop_mkfs_opts |grep log - mount -o loop -t xfs $LOOP_DEV $LOOP_MNT + _mount -o loop -t xfs $LOOP_DEV $LOOP_MNT echo "test write" > $LOOP_MNT/test - umount $LOOP_MNT > /dev/null 2>&1 + _unmount $LOOP_MNT > /dev/null 2>&1 done } # make large holey file diff --git a/tests/xfs/217 b/tests/xfs/217 index 41caaf738..b2eb34490 100755 --- a/tests/xfs/217 +++ b/tests/xfs/217 @@ -29,9 +29,9 @@ _do_mkfs() echo -n "fssize=${i}g " $MKFS_XFS_PROG -f -b size=4096 -l version=2 \ -d name=$LOOP_DEV,size=${i}g |grep log - mount -o loop -t xfs $LOOP_DEV $LOOP_MNT + _mount -o loop -t xfs $LOOP_DEV $LOOP_MNT echo "test write" > $LOOP_MNT/test - umount $LOOP_MNT > /dev/null 2>&1 + _unmount $LOOP_MNT > /dev/null 2>&1 # punch out the previous blocks so that we keep the amount of # disk space the test requires down to a minimum. diff --git a/tests/xfs/250 b/tests/xfs/250 index f8846be6e..4e3473ebc 100755 --- a/tests/xfs/250 +++ b/tests/xfs/250 @@ -13,9 +13,10 @@ _begin_fstest auto quick rw prealloc metadata _cleanup() { cd / - umount $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null rm -f $LOOP_DEV rmdir $LOOP_MNT + rm -f $tmp.* } # Import common functions. @@ -54,13 +55,13 @@ _test_loop() | _filter_mkfs 2>/dev/null echo "*** mount loop filesystem" - mount -t xfs -o loop $LOOP_DEV $LOOP_MNT + _mount -t xfs -o loop $LOOP_DEV $LOOP_MNT echo "*** preallocate large file" $XFS_IO_PROG -f -c "resvsp 0 $fsize" $LOOP_MNT/foo | _filter_io echo "*** unmount loop filesystem" - umount $LOOP_MNT > /dev/null 2>&1 + _unmount $LOOP_MNT > /dev/null 2>&1 echo "*** check loop filesystem" _check_xfs_filesystem $LOOP_DEV none none diff --git a/tests/xfs/289 b/tests/xfs/289 index cf0f2883c..d234f212d 100755 --- a/tests/xfs/289 +++ b/tests/xfs/289 @@ -13,8 +13,8 @@ _begin_fstest growfs auto quick # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $tmpdir - $UMOUNT_PROG $tmpbind + _unmount $tmpdir + _unmount $tmpbind rmdir $tmpdir rm -f $tmpsymlink rmdir $tmpbind diff --git a/tests/xfs/507 b/tests/xfs/507 index 75c183c07..52d9b94b4 100755 --- a/tests/xfs/507 +++ b/tests/xfs/507 @@ -22,7 +22,7 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - test -n "$loop_mount" && $UMOUNT_PROG $loop_mount > /dev/null 2>&1 + test -n "$loop_mount" && _unmount $loop_mount > /dev/null 2>&1 test -n "$loop_dev" && _destroy_loop_device $loop_dev rm -rf $tmp.* } diff --git a/tests/xfs/513 b/tests/xfs/513 index 5585a9c8e..5895e6e2d 100755 --- a/tests/xfs/513 +++ b/tests/xfs/513 @@ -14,7 +14,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null if [ -n "$LOOP_DEV" ];then _destroy_loop_device $LOOP_DEV 2>/dev/null fi @@ -89,7 +89,7 @@ get_mount_info() force_unmount() { - $UMOUNT_PROG $LOOP_MNT >/dev/null 2>&1 + _unmount $LOOP_MNT >/dev/null 2>&1 } # _do_test [ ] diff --git a/tests/xfs/544 b/tests/xfs/544 index bd694453d..b7eef51c7 100755 --- a/tests/xfs/544 +++ b/tests/xfs/544 @@ -15,7 +15,7 @@ _cleanup() _cleanup_dump cd / rm -r -f $tmp.* - $UMOUNT_PROG $TEST_DIR/dest.$seq 2> /dev/null + _unmount $TEST_DIR/dest.$seq 2> /dev/null rmdir $TEST_DIR/src.$seq 2> /dev/null rmdir $TEST_DIR/dest.$seq 2> /dev/null } diff --git a/tests/xfs/606 b/tests/xfs/606 index 02de601d6..f958bddd8 100755 --- a/tests/xfs/606 +++ b/tests/xfs/606 @@ -14,7 +14,7 @@ _begin_fstest auto quick growfs _cleanup() { local dev - $UMOUNT_PROG $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null dev=$(losetup -j testfile | cut -d: -f1) losetup -d $dev 2>/dev/null rm -rf $LOOP_IMG $LOOP_MNT diff --git a/tests/xfs/613 b/tests/xfs/613 index 1947afec7..6ba3d87bf 100755 --- a/tests/xfs/613 +++ b/tests/xfs/613 @@ -14,7 +14,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null if [ -n "$LOOP_DEV" ];then _destroy_loop_device $LOOP_DEV 2>/dev/null fi @@ -90,7 +90,7 @@ get_mount_info() force_unmount() { - $UMOUNT_PROG $LOOP_MNT >/dev/null 2>&1 + _unmount $LOOP_MNT >/dev/null 2>&1 } # _do_test [ ] From patchwork Wed Nov 27 04:51:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886554 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD38513CFB8 for ; Wed, 27 Nov 2024 04:54:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683256; cv=none; b=XsInbbnSMDS2MUaWtrhRB8EZy38gOVHOB13o9JCpJAHOjWf+AKh229WLx7a/abZVDuQzqaT8fbtIfAdU729RBvdEpDCzfrzK9t+8d1+yUjxwcUxl4DYdwLjfhvTI5gmu/yTqsUsJdcpvicx95npiVuYjF7zt37d0XZb4gjR4dow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683256; c=relaxed/simple; bh=DckRhDjs/2NlGG0N/9oDI0PIKIbmlqkGm72E4rgqk+A=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O3g7w8U2HbbfnCMakswo7zjVvxZifJCvK0GlPHMQXM6T0/h+yp1Pvapc39h4KShhzlt+Ka9uUXfzwBXZWT21Ry+VWxD6fw4YnX8kpSu0nqRfzni0PCOfHObr8zn0LbfbVIU5iUekKADe/Y3LFjjjlFFObwl6hxLkhXvCxWRY0f8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=HGIUYgaA; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="HGIUYgaA" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-7251abe0e69so2061795b3a.0 for ; Tue, 26 Nov 2024 20:54:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683253; x=1733288053; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zDaNBLQxO7qhw0bLUuzh2sc8g1eQoqDd2mupKYSqaRA=; b=HGIUYgaA0Cuc681qJXetzgQBjfKNpw4z7Y2GR8UirOAbdSoA2HiOn3TDe/fJH5HscP H97h2yjYvnh6mY6V8l1XKvWVuToy2k+E2tvcYdRVHzPF1aqnK6+WRBuJlQ4I7B/MWnE5 FcyThx3qYsANOuTmyBvD5G6LrPMCyEuFd6h9vjrmUtJIZARisN/+0ucu8G/6g7MO7STn N/5wI/hHv1YjGl+2iLLtwSG4hlVwS2CVBfao/xMzcPXjWVeiVnubk5D9XV7eyCO7CvaZ KIPQoeSdxlpWGhtMf/YaDFZsfkuVYuIPwCXom6Fpf66R7Bk/3ZfDIvAHP3EV4jjvVqnT +8pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683253; x=1733288053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zDaNBLQxO7qhw0bLUuzh2sc8g1eQoqDd2mupKYSqaRA=; b=YSOkjqX5HI5nVRCLqdkr55XRCcKae4mrjCZ7/KFTi4xyB6oYGTMkvHpRbLyI3oS0Nv OWKy1KB0yuasaFbIONQPxjlSOO48pzuwwARDxRF20PfWXIEba4AH7KlpYfzaoGzlbXcQ BbUbSSUch1HRcT5YDekTYVw92VQYUSyr4FCPOYYWoYLniduM0nQjcktI0jwKdudNfeET ohAZRaJhiNgQ2hlt5vJxMxlhkeJKQKh7KKJ3Jot0Y/d4bAkT7p9JehK+Q6haMeyll6UR dQgMdz9t91tkPo4P9T3Pr+aCDP70wXEMbB4lsMBWC8cvPgb9L2dRka938poSXJt4Zy3l dLSQ== X-Gm-Message-State: AOJu0YywqCxudRhqdvr/EvvuaSQJKdhlyR7TdW/OipQfEbLBlvk4kX3I +wytSLR3bR7vUSUsrqWjZhpNwGrOelgdAfle2TGiW3UHPfcSnlEfdI/u6TwQh+Pj9WyFkY9pDpY t X-Gm-Gg: ASbGncvVuHCWxlVPUtwgSx7jjmOeNjNMnWKj3q8zhYlPb7Al9tLpCHA93sTz4v24Sqj LQO6AX6AWrl3kkGYYXWSrtiMslujs/VV834iJaCN23eeGC8NnOSl2iB3kd4d4jlddhMHJVfuEui lZAAoUSepoPRt0KyOlvH3Rof4Q9eybZJB9GHBDBZ58lZLwuJyaUYZyzPztdDUkQU4NAuUuoUxDp GeO63Oa76yhfPKm3OLrQxSkpliek71RCObZJedGiVVT9pnYRGT8FWA5w23DZmRanu7uVEIUZK0r Hb5XYh6TXO6VfsEe45ZpAPcv X-Google-Smtp-Source: AGHT+IHl6iCsdSp21v6TIR1lb6+xVSDtImCQO5ZbsMK9mAo0hEIsSCOnGklKaJiCPw32oAACMYHxIg== X-Received: by 2002:a05:6a21:3987:b0:1d9:1a77:3875 with SMTP id adf61e73a8af0-1e0e0b7e159mr2692651637.42.1732683252669; Tue, 26 Nov 2024 20:54:12 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724de45725dsm9255356b3a.16.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:10 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZUe-0u3L for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQeT-1Kgp for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 13/40] fstests: clean up loop device instantiation Date: Wed, 27 Nov 2024 15:51:43 +1100 Message-ID: <20241127045403.3665299-14-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Lots of tests do there own special thing with loop devices rather than using _create_loop_device() and _destroy_loop_device(). This oftens means they do not clean up after themselves properly, leaving stale loop devices around that result in unmountable test or scratch devices. This is common when tests are killed by user interrupt. Even the tests that do use _destroy_loop_device and try to clean up often do it incorrectly, leading to spurious error messages. Some tests try to use dynamic instantiation via "mount -o loop", but then don't clean up in the correct order or hack around to find the loop device that was instantiated because the test needs to know the instantiated device name Clean this up by converting all the tests to use _create_loop_device() and _destroy_loop_device(). In all the tests, use the variable "loop_dev" for the device consistently. In _destroy_loop_device(), test that a device name has been passed so that we don't try to clean up the same device twice (e.g. once before test exit and again from the _cleanup() function). When we destroy a loop device, unset the variable used to hold the loop device name so that we don't try to destroy it twice. This results in much more reliable cleanup and clean exit from fstests when killed by the user. Signed-off-by: Dave Chinner --- common/metadump | 32 ++++++++++++-------------------- tests/generic/067 | 11 ++++++++--- tests/generic/361 | 6 +++++- tests/generic/563 | 14 +++++++++----- tests/generic/564 | 12 ++++++------ tests/generic/590 | 9 ++++++--- tests/generic/744 | 4 ++-- tests/generic/746 | 6 +++++- tests/xfs/014 | 7 +++++-- tests/xfs/049 | 35 +++++++++++++++++++++-------------- tests/xfs/073 | 24 +++++++++++++----------- tests/xfs/074 | 21 ++++++++++++--------- tests/xfs/078 | 16 +++++++++------- tests/xfs/148 | 23 ++++++++++++++--------- tests/xfs/149 | 4 ++++ tests/xfs/216 | 15 ++++++++++----- tests/xfs/217 | 22 ++++++++++++++++------ tests/xfs/250 | 14 +++++++++----- tests/xfs/259 | 13 ++++++++----- tests/xfs/513 | 44 ++++++++++++++++++++------------------------ tests/xfs/521 | 8 ++++++-- tests/xfs/528 | 10 +++++++--- tests/xfs/530 | 11 ++++++----- tests/xfs/606 | 12 ++++++++---- tests/xfs/613 | 40 ++++++++++++++-------------------------- tests/xfs/613.out | 1 - 26 files changed, 235 insertions(+), 179 deletions(-) diff --git a/common/metadump b/common/metadump index 3373edfe9..bc3038e3b 100644 --- a/common/metadump +++ b/common/metadump @@ -24,17 +24,9 @@ _xfs_cleanup_verify_metadump() test -n "$XFS_METADUMP_FILE" && rm -f "$XFS_METADUMP_FILE" - if [ -n "$XFS_METADUMP_IMG" ]; then - losetup -n -a -O BACK-FILE,NAME | grep "^$XFS_METADUMP_IMG" | while read backing ldev; do - losetup -d "$ldev" - done - - # Don't call rm directly with a globbed argument here to avoid - # issues issues with variable expansions. - for img in "$XFS_METADUMP_IMG"*; do - test -e "$img" && rm -f "$img" - done - fi + [ -n "$md_data_loop_dev" ] && _destroy_loop_device $md_data_loop_dev + [ -n "$md_log_loop_dev" ] && _destroy_loop_device $md_log_loop_dev + rm -f $data_img $log_img } # Can xfs_metadump snapshot the fs metadata to a v1 metadump file? @@ -122,25 +114,25 @@ _xfs_verify_metadump_v2() _scratch_xfs_mdrestore $metadump_file # Create loopdev for data device so we can mount the fs - data_loop=$(_create_loop_device $data_img) + md_data_loop_dev=$(_create_loop_device $data_img) # Create loopdev for log device if we recovered anything - test -s "$log_img" && log_loop=$(_create_loop_device $log_img) + test -s "$log_img" && md_log_loop_dev=$(_create_loop_device $log_img) # Mount fs, run an extra test, fsck, and unmount - SCRATCH_DEV=$data_loop SCRATCH_LOGDEV=$log_loop _scratch_mount + SCRATCH_DEV=$md_data_loop_dev SCRATCH_LOGDEV=$md_log_loop_dev _scratch_mount if [ -n "$extra_test" ]; then - SCRATCH_DEV=$data_loop SCRATCH_LOGDEV=$log_loop $extra_test + SCRATCH_DEV=$md_data_loop_dev SCRATCH_LOGDEV=$md_log_loop_dev $extra_test fi - SCRATCH_DEV=$data_loop SCRATCH_LOGDEV=$log_loop _check_xfs_scratch_fs - SCRATCH_DEV=$data_loop _scratch_unmount + SCRATCH_DEV=$md_data_loop_dev SCRATCH_LOGDEV=$md_log_loop_dev _check_xfs_scratch_fs + _unmount $md_data_loop_dev # Tear down what we created - if [ -b "$log_loop" ]; then - _destroy_loop_device $log_loop + if [ -b "$md_log_loop_dev" ]; then + _destroy_loop_device $md_log_loop_dev rm -f $log_img fi - _destroy_loop_device $data_loop + _destroy_loop_device $md_data_loop_dev rm -f $data_img } diff --git a/tests/generic/067 b/tests/generic/067 index ccb1e3fbb..b45ae834f 100755 --- a/tests/generic/067 +++ b/tests/generic/067 @@ -37,13 +37,18 @@ mount_nonexistent_mnt() $MOUNT_PROG $SCRATCH_DEV $TEST_DIR/nosuchdir >>$seqres.full 2>&1 } -# fs driver should be able to handle mounting a free loop device gracefully -# xfs ever hung, "ec53d1d xfs: don't block on buffer read errors" fixed it +# fs driver should be able to handle mounting a free loop device gracefully xfs +# ever hung, "ec53d1d xfs: don't block on buffer read errors" fixed it +# +# Using 'losetup -f' like this is racy. We might end up mounting a real loop dev +# here, so unmount $SCRATCH_MNT (not the loop dev we might not own!) and ignore +# any error it might return. mount_free_loopdev() { echo "# mount a free loop device" >>$seqres.full loopdev=`losetup -f` - $MOUNT_PROG -t $FSTYP $loopdev $SCRATCH_MNT >>$seqres.full 2>&1 + _mount $loopdev $SCRATCH_MNT >>$seqres.full 2>&1 + _unmount $SCRATCH_MNT >> /dev/null 2>&1 } # mount with wrong fs type specified. diff --git a/tests/generic/361 b/tests/generic/361 index 7273dd056..e2b798436 100755 --- a/tests/generic/361 +++ b/tests/generic/361 @@ -17,7 +17,7 @@ _begin_fstest auto quick _cleanup() { _unmount $fs_mnt - _destroy_loop_device $loop_dev + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev cd / rm -f $tmp.* } @@ -54,6 +54,10 @@ $XFS_IO_PROG -fc "pwrite 0 520m" $fs_mnt/testfile >>$seqres.full 2>&1 # remount should not hang $MOUNT_PROG -o remount,ro $fs_mnt >>$seqres.full 2>&1 +_unmount $fs_mnt +_destroy_loop_device $loop_dev +unset loop_dev + # success, all done echo "Silence is golden" status=0 diff --git a/tests/generic/563 b/tests/generic/563 index f0d2f404c..34d21170c 100755 --- a/tests/generic/563 +++ b/tests/generic/563 @@ -87,12 +87,12 @@ reset() # cgroup I/O accounting doesn't work on partitions. Use a loop device to rule # that out. -LOOP_DEV=$(_create_loop_device $SCRATCH_DEV) -smajor=$((0x`stat -L -c %t $LOOP_DEV`)) -sminor=$((0x`stat -L -c %T $LOOP_DEV`)) +loop_dev=$(_create_loop_device $SCRATCH_DEV) +smajor=$((0x`stat -L -c %t $loop_dev`)) +sminor=$((0x`stat -L -c %T $loop_dev`)) -_mkfs_dev $LOOP_DEV >> $seqres.full 2>&1 -_mount $LOOP_DEV $SCRATCH_MNT || _fail "mount failed" +_mkfs_dev $loop_dev >> $seqres.full 2>&1 +_mount $loop_dev $SCRATCH_MNT || _fail "mount failed" blksize=$(_get_block_size "$SCRATCH_MNT") @@ -147,6 +147,10 @@ if [ "$drop_io_cgroup" = 1 ]; then echo "-io" > $cgdir/cgroup.subtree_control || _fail "subtree control" fi +_unmount $SCRATCH_MNT +_destroy_loop_device $loop_dev +unset loop_dev + # success, all done status=0 exit diff --git a/tests/generic/564 b/tests/generic/564 index 647472d78..b66b72496 100755 --- a/tests/generic/564 +++ b/tests/generic/564 @@ -19,7 +19,7 @@ _cleanup() { cd / rm -rf $tmp.* - [ -z "$loopdev" ] || _destroy_loop_device $loopdev + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev } # Import common functions. @@ -72,11 +72,11 @@ $XFS_IO_PROG -f -c "copy_range -l 32k $testdir" $testdir/copy echo echo source/destination as blkdev returns EINVAL $XFS_IO_PROG -f -c "truncate 128k" $testdir/img >> $seqres.full 2>&1 -loopdev=`_create_loop_device $testdir/img` -$XFS_IO_PROG -c "copy_range -l 32k $testdir/file" $loopdev -$XFS_IO_PROG -f -c "copy_range -l 32k $loopdev" $testdir/copy -_destroy_loop_device $loopdev -loopdev= +loop_dev=`_create_loop_device $testdir/img` +$XFS_IO_PROG -c "copy_range -l 32k $testdir/file" $loop_dev +$XFS_IO_PROG -f -c "copy_range -l 32k $loop_dev" $testdir/copy +_destroy_loop_device $loop_dev +unset loop_dev echo echo source/destination as chardev returns EINVAL diff --git a/tests/generic/590 b/tests/generic/590 index 2b7ccfb53..2eefa2c62 100755 --- a/tests/generic/590 +++ b/tests/generic/590 @@ -15,9 +15,10 @@ _begin_fstest auto prealloc preallocrw # Override the default cleanup function. _cleanup() { + _scratch_unmount + [ -n $loop_dev ] && _destroy_loop_device $loop_dev cd / rm -f $tmp.* - test -n "$loop" && _destroy_loop_device "$loop" rm -f "$TEST_DIR/$seq" } @@ -56,9 +57,9 @@ if [[ $FSTYP = xfs ]]; then loopsz="$((filesz + (1 << 26)))" _require_fs_space "$TEST_DIR" $((loopsz / 1024)) $XFS_IO_PROG -c "truncate $loopsz" -f "$TEST_DIR/$seq" - loop="$(_create_loop_device "$TEST_DIR/$seq")" + loop_dev="$(_create_loop_device "$TEST_DIR/$seq")" USE_EXTERNAL=yes - SCRATCH_RTDEV="$loop" + SCRATCH_RTDEV="$loop_dev" disabled_features=() # disable reflink if not supported by realtime devices @@ -114,6 +115,8 @@ $XFS_IO_PROG -c "truncate 0" -c fsync "$SCRATCH_MNT/file" # We need to do this before the loop device gets torn down. _scratch_unmount _check_scratch_fs +_destroy_loop_device $loop_dev +unset loop_dev echo "Silence is golden" status=0 diff --git a/tests/generic/744 b/tests/generic/744 index df8f6ae9b..cda10e0f6 100755 --- a/tests/generic/744 +++ b/tests/generic/744 @@ -17,8 +17,8 @@ _cleanup() _unmount $mnt2 &> /dev/null _unmount $mnt1 &> /dev/null - [ -b "$loop_dev2" ] && losetup -d $loop_dev2 - [ -b "$loop_dev1" ] && losetup -d $loop_dev1 + [ -b "$loop_dev2" ] && _destroy_loop_device $loop_dev2 + [ -b "$loop_dev1" ] && _destroy_loop_device $loop_dev1 [ -n "$seq" ] && rm -rf $TEST_DIR/$seq } diff --git a/tests/generic/746 b/tests/generic/746 index 671910606..ba8ed25e8 100755 --- a/tests/generic/746 +++ b/tests/generic/746 @@ -39,7 +39,7 @@ esac _cleanup() { _unmount $loop_mnt &> /dev/null - _destroy_loop_device $loop_dev + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev if [ $status -eq 0 ]; then rm -rf $tmp rm $img_file @@ -223,5 +223,9 @@ while read line; do done < $fiemap_after echo "done." +_unmount $loop_mnt +_destroy_loop_device $loop_dev +unset loop_dev + status=0 exit diff --git a/tests/xfs/014 b/tests/xfs/014 index f638e4b16..39ea40e2a 100755 --- a/tests/xfs/014 +++ b/tests/xfs/014 @@ -23,6 +23,7 @@ _cleanup() { cd / _unmount $LOOP_MNT 2>/dev/null + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev _scratch_unmount 2>/dev/null rm -f $tmp.* } @@ -166,19 +167,21 @@ LOOP_FILE=$SCRATCH_MNT/$seq.fs LOOP_MNT=$SCRATCH_MNT/$seq.mnt $MKFS_XFS_PROG -d "file=1,name=$LOOP_FILE,size=10g" >> $seqres.full 2>&1 +loop_dev=$(_create_loop_device $LOOP_FILE) mkdir -p $LOOP_MNT -_mount -o uquota,gquota $LOOP_FILE $LOOP_MNT || \ +_mount -o uquota,gquota $loop_dev $LOOP_MNT || \ _fail "Failed to mount loop fs." _test_enospc $LOOP_MNT _test_edquot $LOOP_MNT _unmount $LOOP_MNT +_destroy_loop_device $loop_dev +unset loop_dev echo $orig_sp_time > /proc/sys/fs/xfs/speculative_prealloc_lifetime _scratch_unmount - status=0 exit diff --git a/tests/xfs/049 b/tests/xfs/049 index 4163a144f..cdcddf764 100755 --- a/tests/xfs/049 +++ b/tests/xfs/049 @@ -12,16 +12,17 @@ _begin_fstest rw auto quick # Override the default cleanup function. _cleanup() { - cd / - umount $SCRATCH_MNT/test2 > /dev/null 2>&1 - umount $SCRATCH_MNT/test > /dev/null 2>&1 - rm -f $tmp.* + cd / + _unmount $SCRATCH_MNT/test2 > /dev/null 2>&1 + _unmount $SCRATCH_MNT/test > /dev/null 2>&1 + [ -n "$loop_dev2" ] && _destroy_loop_device $loop_dev2 + [ -n "$loop_dev1" ] && _destroy_loop_device $loop_dev1 + rm -f $tmp.* - if [ -w $seqres.full ] - then - echo "--- mounts at end (after cleanup)" >> $seqres.full - mount >> $seqres.full - fi + if [ -w $seqres.full ]; then + echo "--- mounts at end (after cleanup)" >> $seqres.full + mount >> $seqres.full + fi } # Import common functions. @@ -64,7 +65,8 @@ mkdir $SCRATCH_MNT/test $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \ || _fail "!!! failed to make mount points" _log "Mount xfs via loop" -mount -t xfs -o loop $SCRATCH_MNT/test.xfs $SCRATCH_MNT/test >> $seqres.full 2>&1 \ +loop_dev1=$(_create_loop_device $SCRATCH_MNT/test.xfs) +_mount $loop_dev1 $SCRATCH_MNT/test >> $seqres.full 2>&1 \ || _fail "!!! failed to loop mount xfs" _log "stress" @@ -80,11 +82,12 @@ dd if=/dev/zero of=$SCRATCH_MNT/test/test.ext2 bs=1024 count=10240 >> $seqres.fu || _fail "!!! create file failed" _log "Create ext2 fs in file on looped xfs" -echo y | mkfs -t ext2 $SCRATCH_MNT/test/test.ext2 >> $seqres.full 2>&1 \ +loop_dev2=$(_create_loop_device $SCRATCH_MNT/test/test.ext2) +echo y | mkfs -t ext2 $loop_dev2 >> $seqres.full 2>&1 \ || _fail "!!! failed to mkfs ext2 on xfs" _log "Mount ext2 on xfs via loop" -mount -t ext2 -o loop $SCRATCH_MNT/test/test.ext2 $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \ +_mount $loop_dev2 $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \ || _fail "!!! failed to loop mount xfs" _log "stress ext2 on xfs via loop" @@ -96,12 +99,16 @@ rm -rf $SCRATCH_MNT/test/* >> $seqres.full 2>&1 \ || _fail "!!! clean failed" _log "umount ext2 on xfs" -umount $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \ +_unmount $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \ || _fail "!!! umount ext2 failed" +_destroy_loop_device $loop_dev2 +unset loop_dev2 _log "umount xfs" -umount $SCRATCH_MNT/test >> $seqres.full 2>&1 \ +_unmount $SCRATCH_MNT/test >> $seqres.full 2>&1 \ || _fail "!!! umount xfs failed" +_destroy_loop_device $loop_dev1 +unset loop_dev1 echo "--- mounts at end (before cleanup)" >> $seqres.full mount >> $seqres.full diff --git a/tests/xfs/073 b/tests/xfs/073 index e4b17c5e7..2274079ef 100755 --- a/tests/xfs/073 +++ b/tests/xfs/073 @@ -23,6 +23,8 @@ _cleanup() _scratch_unmount 2>/dev/null _unmount $imgs.loop 2>/dev/null _unmount $imgs.source_dir 2>/dev/null + [ -n "$loop_dev1" ] && _destroy_loop_device $loop_dev1 + [ -n "$loop_dev2" ] && _destroy_loop_device $loop_dev2 [ -d $imgs.loop ] && rmdir $imgs.loop [ -d $imgs.source_dir ] && rm -rf $imgs.source_dir rm -f $imgs.* $tmp.* /var/tmp/xfs_copy.log.* @@ -65,10 +67,11 @@ _verify_copy() rmdir $target_dir 2>/dev/null mkdir $target_dir - _mount -t xfs -o loop $target $target_dir 2>/dev/null + loop_dev1=$(_create_loop_device $target) + _mount $loop_dev1 $target_dir 2>/dev/null if [ $? -ne 0 ]; then echo retrying mount with nouuid option >>$seqres.full - _mount -t xfs -o loop -o nouuid $target $target_dir + _mount -o nouuid $loop_dev1 $target_dir if [ $? -ne 0 ]; then echo mount failed - evil! return @@ -100,6 +103,8 @@ _verify_copy() echo unmounting and removing new image _unmount $source_dir _unmount $target_dir > /dev/null 2>&1 + _destroy_loop_device $loop_dev1 + unset loop_dev1 rm -f $target } @@ -134,18 +139,15 @@ ${MKFS_XFS_PROG} -dfile,name=$imgs.source,size=100g \ rmdir $imgs.source_dir 2>/dev/null mkdir $imgs.source_dir -_mount -t xfs -o loop $imgs.source $imgs.source_dir -loop2=`mount | grep $imgs.source | grep -o -e 'loop=.*[^),]' | grep -o -e '/.*$'` +loop_dev2=$(_create_loop_device $imgs.source) +_mount $loop_dev2 $imgs.source_dir cp -a $here $imgs.source_dir -_mount -t xfs -o remount,ro $imgs.source $imgs.source_dir -$XFS_COPY_PROG $imgs.source $imgs.image | _filter_copy '#' $imgs.image '#' '#' +_mount -o remount,ro $loop_dev2 $imgs.source_dir +$XFS_COPY_PROG $loop_dev2 $imgs.image 2> /dev/null | _filter_copy '#' $imgs.image '#' '#' _verify_copy $imgs.image $imgs.source $imgs.source_dir -# HACK WARNING: -# -# We're done with the nested loop mount, now we have to clean -# up the pieces that mount is incapable of doing. -losetup -d $loop2 > /dev/null 2>&1 +_destroy_loop_device $loop_dev2 +unset loop_dev2 echo echo === copying scratch device to multiple targets diff --git a/tests/xfs/074 b/tests/xfs/074 index 6a03c8111..5df864fad 100755 --- a/tests/xfs/074 +++ b/tests/xfs/074 @@ -26,7 +26,7 @@ _begin_fstest quick auto prealloc rw _cleanup() { cd / - _destroy_loop_device $LOOP_DEV + [ -n "$loop_dev" ] &&_destroy_loop_device $loop_dev rm -f $tmp.* $LOOP_FILE } @@ -45,10 +45,10 @@ LOOP_FILE=$TEST_DIR/$seq.img LOOP_MNT=$TEST_DIR/$seq.mnt mkdir -p $LOOP_MNT $XFS_IO_PROG -ft -c "truncate 1t" $LOOP_FILE >> $seqres.full -LOOP_DEV=`_create_loop_device $LOOP_FILE` +loop_dev=`_create_loop_device $LOOP_FILE` -_mkfs_dev -d size=260g,agcount=2 $LOOP_DEV -_mount $LOOP_DEV $LOOP_MNT +_mkfs_dev -d size=260g,agcount=2 $loop_dev +_mount $loop_dev $LOOP_MNT BLOCK_SIZE=$(_get_file_block_size $LOOP_MNT) @@ -59,11 +59,11 @@ $XFS_IO_PROG -ft \ -c "falloc 0 $(($BLOCK_SIZE * 2097152))" \ $LOOP_MNT/foo >> $seqres.full -umount $LOOP_MNT -_check_xfs_filesystem $LOOP_DEV none none +_unmount $LOOP_MNT +_check_xfs_filesystem $loop_dev none none -_mkfs_dev -f $LOOP_DEV -_mount $LOOP_DEV $LOOP_MNT +_mkfs_dev -f $loop_dev +_mount $loop_dev $LOOP_MNT # check we trim both ends of the extent approproiately; this will fail # on 1k block size filesystems without the correct fixes in place. @@ -73,7 +73,10 @@ $XFS_IO_PROG -ft \ $LOOP_MNT/foo >> $seqres.full _unmount $LOOP_MNT -_check_xfs_filesystem $LOOP_DEV none none +_check_xfs_filesystem $loop_dev none none + +_destroy_loop_device $loop_dev +unset loop_dev # success, all done echo "Silence is golden" diff --git a/tests/xfs/078 b/tests/xfs/078 index 6b325e05f..0d3c2eb23 100755 --- a/tests/xfs/078 +++ b/tests/xfs/078 @@ -17,7 +17,7 @@ _cleanup() cd / rm -f $tmp.* _unmount $LOOP_MNT 2>/dev/null - [ -n "$LOOP_DEV" ] && _destroy_loop_device $LOOP_DEV 2>/dev/null + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev 2>/dev/null # try to keep the image file if test fails [ $status -eq 0 ] && rm -f $LOOP_IMG rmdir $LOOP_MNT @@ -55,7 +55,7 @@ _grow_loop() agsize=$5 $XFS_IO_PROG -f -c "truncate $original" $LOOP_IMG - LOOP_DEV=`_create_loop_device $LOOP_IMG` + loop_dev=`_create_loop_device $LOOP_IMG` dparam="" if [ -n "$agsize" ]; then @@ -67,15 +67,15 @@ _grow_loop() echo echo "*** mkfs loop file (size=$original)" - $MKFS_XFS_PROG -b size=$bsize $dparam $LOOP_DEV | \ + $MKFS_XFS_PROG -b size=$bsize $dparam $loop_dev | \ _filter_mkfs 2>/dev/null echo "*** extend loop file" - _destroy_loop_device $LOOP_DEV + _destroy_loop_device $loop_dev $XFS_IO_PROG -c "pwrite $new_size $bsize" $LOOP_IMG | _filter_io - LOOP_DEV=`_create_loop_device $LOOP_IMG` + loop_dev=`_create_loop_device $LOOP_IMG` echo "*** mount loop filesystem" - _mount -t xfs $LOOP_DEV $LOOP_MNT + _mount $loop_dev $LOOP_MNT echo "*** grow loop filesystem" $XFS_GROWFS_PROG $LOOP_MNT 2>&1 | _filter_growfs 2>&1 @@ -87,9 +87,11 @@ _grow_loop() if [ "$check" -gt "0" ] then echo "*** check" - _check_xfs_filesystem $LOOP_IMG none none + _check_xfs_filesystem $loop_dev none none fi + _destroy_loop_device $loop_dev + unset loop_dev rm -f $LOOP_IMG } diff --git a/tests/xfs/148 b/tests/xfs/148 index c42c9b119..4d2f7a808 100755 --- a/tests/xfs/148 +++ b/tests/xfs/148 @@ -15,7 +15,7 @@ _cleanup() { cd / _unmount $mntpt > /dev/null 2>&1 - _destroy_loop_device $loopdev > /dev/null 2>&1 + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev rm -r -f $tmp.* } @@ -48,12 +48,12 @@ rm -f $imgfile $imgfile.old # even when security xattrs are present so we are always doing name matches on # lookup and not name hash compares as leaf/node forms will do. $XFS_IO_PROG -f -c 'truncate 40m' $imgfile -loopdev=$(_create_loop_device $imgfile) -MKFS_OPTIONS="-m crc=0 -i size=512" _mkfs_dev $loopdev >> $seqres.full +loop_dev=$(_create_loop_device $imgfile) +MKFS_OPTIONS="-m crc=0 -i size=512" _mkfs_dev $loop_dev >> $seqres.full # Mount image file mkdir -p $mntpt -_mount $loopdev $mntpt +_mount $loop_dev $mntpt echo "creating entries" >> $seqres.full @@ -91,7 +91,8 @@ cat $tmp.log | _filter_test_dir # Corrupt the entries _unmount $mntpt -_destroy_loop_device $loopdev +_destroy_loop_device $loop_dev +unset loop_dev cp $imgfile $imgfile.old sed -b \ -e "s/$nullstr/too_many\x00beans/g" \ @@ -99,8 +100,9 @@ sed -b \ -i $imgfile test "$(md5sum < $imgfile)" != "$(md5sum < $imgfile.old)" || _fail "sed failed to change the image file?" -loopdev=$(_create_loop_device $imgfile) -_mount $loopdev $mntpt + +loop_dev=$(_create_loop_device $imgfile) +_mount $loop_dev $mntpt # Try to access the corrupt metadata echo "++ ACCESSING BAD METADATA" | tee -a $seqres.full @@ -111,7 +113,7 @@ cat $tmp.log | _filter_test_dir | sed -e '/Could not list/d' echo "does scrub complain?" >> $seqres.full # Does scrub complain about this? -if _supports_xfs_scrub $mntpt $loopdev; then +if _supports_xfs_scrub $mntpt $loop_dev; then $XFS_SCRUB_PROG -n $mntpt >> $seqres.full 2>&1 res=$? test $((res & 1)) -eq 0 && \ @@ -122,11 +124,14 @@ echo "does repair complain?" >> $seqres.full # Does repair complain about this? _unmount $mntpt -$XFS_REPAIR_PROG -n $loopdev >> $seqres.full 2>&1 +$XFS_REPAIR_PROG -n $loop_dev >> $seqres.full 2>&1 res=$? test $res -eq 1 || \ echo "repair failed to report corruption ($res)" +_destroy_loop_device $loop_dev +unset loop_dev + # success, all done status=0 exit diff --git a/tests/xfs/149 b/tests/xfs/149 index f2187109b..9a96f82ed 100755 --- a/tests/xfs/149 +++ b/tests/xfs/149 @@ -84,6 +84,10 @@ $XFS_GROWFS_PROG -D 16384 $loop_symlink > /dev/null echo "=== xfs_growfs - check device node ===" $XFS_GROWFS_PROG -D 20480 $loop_dev > /dev/null +_unmount $mntdir +_destroy_loop_device $loop_dev +unset loop_dev + # success, all done status=0 exit diff --git a/tests/xfs/216 b/tests/xfs/216 index 6b8b2eb22..091c11d08 100755 --- a/tests/xfs/216 +++ b/tests/xfs/216 @@ -15,6 +15,7 @@ _begin_fstest log metadata auto quick _cleanup() { _unmount $LOOP_MNT > /dev/null 2>&1 + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev cd / rm -f $tmp.* } @@ -24,7 +25,7 @@ _scratch_mkfs_xfs >/dev/null 2>&1 _scratch_mount _require_loop -LOOP_DEV=$SCRATCH_MNT/test_fs +LOOP_IMG=$SCRATCH_MNT/test_fs LOOP_MNT=$SCRATCH_MNT/test_fs_dir loop_mkfs_opts= @@ -55,22 +56,26 @@ _do_mkfs() for i in $*; do echo -n "fssize=${i}g " $MKFS_XFS_PROG -f -b size=4096 -l version=2 \ - -d name=$LOOP_DEV,size=${i}g $loop_mkfs_opts |grep log - _mount -o loop -t xfs $LOOP_DEV $LOOP_MNT + -d size=${i}g $loop_mkfs_opts $loop_dev |grep log + _mount $loop_dev $LOOP_MNT echo "test write" > $LOOP_MNT/test _unmount $LOOP_MNT > /dev/null 2>&1 done } # make large holey file -$XFS_IO_PROG -f -c "truncate 256g" $LOOP_DEV +$XFS_IO_PROG -f -c "truncate 256g" $LOOP_IMG -choose_golden_output $0 $LOOP_DEV +choose_golden_output $0 $LOOP_IMG #make loopback mount dir mkdir $LOOP_MNT +loop_dev=$(_create_loop_device $LOOP_IMG) + # walk over standard sizes (up to 256GB) _do_mkfs 1 2 4 8 16 32 64 128 256 +_destroy_loop_device $loop_dev +unset loop_dev status=0 exit diff --git a/tests/xfs/217 b/tests/xfs/217 index b2eb34490..dae6ce55f 100755 --- a/tests/xfs/217 +++ b/tests/xfs/217 @@ -12,6 +12,12 @@ _begin_fstest log metadata auto # Import common functions. . ./common/filter +_cleanup() +{ + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev + cd / + rm -f $tmp.* +} _require_scratch _scratch_mkfs_xfs >/dev/null 2>&1 @@ -20,7 +26,7 @@ _scratch_mount _require_fs_space $SCRATCH_MNT 2202000 _require_loop -LOOP_DEV=$SCRATCH_MNT/test_fs +LOOP_IMG=$SCRATCH_MNT/test_fs LOOP_MNT=$SCRATCH_MNT/test_fs_dir _do_mkfs() @@ -28,28 +34,30 @@ _do_mkfs() for i in $*; do echo -n "fssize=${i}g " $MKFS_XFS_PROG -f -b size=4096 -l version=2 \ - -d name=$LOOP_DEV,size=${i}g |grep log - _mount -o loop -t xfs $LOOP_DEV $LOOP_MNT + -d size=${i}g $loop_dev |grep log + _mount $loop_dev $LOOP_MNT echo "test write" > $LOOP_MNT/test _unmount $LOOP_MNT > /dev/null 2>&1 # punch out the previous blocks so that we keep the amount of # disk space the test requires down to a minimum. - $XFS_IO_PROG -f -c "unresvsp 0 16383g" $LOOP_DEV + $XFS_IO_PROG -f -c "unresvsp 0 16383g" $LOOP_IMG done } # make large holey file -$XFS_IO_PROG -f -c "truncate 16383g" $LOOP_DEV +$XFS_IO_PROG -f -c "truncate 16383g" $LOOP_IMG #make loopback mount dir mkdir $LOOP_MNT # test if large logs are supported -$MKFS_XFS_PROG -f -l size=256m -d name=$LOOP_DEV,size=10g > /dev/null 2>&1 +$MKFS_XFS_PROG -f -l size=256m -d name=$LOOP_IMG,size=10g > /dev/null 2>&1 if [ $? -ne 0 ]; then _notrun "large log sizes not supported by mkfs" fi +loop_dev=$(_create_loop_device $LOOP_IMG) + # # walk over "new" sizes supported by recent xfsprogs. # Note that the last test is for 16TB-1GB as 32bit platforms only support @@ -57,5 +65,7 @@ fi # _do_mkfs 512 1024 2048 4096 8192 16383 +_destroy_loop_device $loop_dev +unset loop_dev status=0 exit diff --git a/tests/xfs/250 b/tests/xfs/250 index 4e3473ebc..2554e1e91 100755 --- a/tests/xfs/250 +++ b/tests/xfs/250 @@ -14,7 +14,8 @@ _cleanup() { cd / _unmount $LOOP_MNT 2>/dev/null - rm -f $LOOP_DEV + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev + rm -f $LOOP_IMG rmdir $LOOP_MNT rm -f $tmp.* } @@ -26,7 +27,7 @@ _require_test _require_loop _require_xfs_io_command "falloc" -LOOP_DEV=$TEST_DIR/$seq.fs +LOOP_IMG=$TEST_DIR/$seq.fs LOOP_MNT=$TEST_DIR/$seq.mnt _filter_io() @@ -45,7 +46,7 @@ _test_loop() agsize=$2 fsize=$3 - dparam="file,name=$LOOP_DEV,size=$size" + dparam="file,name=$LOOP_IMG,size=$size" if [ -n "$agsize" ]; then dparam="$dparam,agsize=$agsize" fi @@ -55,7 +56,8 @@ _test_loop() | _filter_mkfs 2>/dev/null echo "*** mount loop filesystem" - _mount -t xfs -o loop $LOOP_DEV $LOOP_MNT + loop_dev=$(_create_loop_device $LOOP_IMG) + mount $loop_dev $LOOP_MNT echo "*** preallocate large file" $XFS_IO_PROG -f -c "resvsp 0 $fsize" $LOOP_MNT/foo | _filter_io @@ -64,7 +66,9 @@ _test_loop() _unmount $LOOP_MNT > /dev/null 2>&1 echo "*** check loop filesystem" - _check_xfs_filesystem $LOOP_DEV none none + _check_xfs_filesystem $loop_dev none none + _destroy_loop_device $loop_dev + unset loop_dev } _test_loop 50g 16m 40G diff --git a/tests/xfs/259 b/tests/xfs/259 index 0c8d6eb56..c2d26381a 100755 --- a/tests/xfs/259 +++ b/tests/xfs/259 @@ -12,7 +12,10 @@ _begin_fstest auto quick # Override the default cleanup function. _cleanup() { - rm -f "$testfile" + [ -n "$loop_dev" ] && _destroy_loop_device $testfile + rm -f "$testfile" + cd / + rm -f $tmp.* } # Import common functions. @@ -45,13 +48,13 @@ for del in $sizes_to_check; do rm -f "$testfile" dd if=/dev/zero "of=$testfile" bs=1 count=0 seek=$ddseek \ >/dev/null 2>&1 || echo "dd failed" - lofile=$(losetup -f) - losetup $lofile "$testfile" - $MKFS_XFS_PROG -l size=32m -b size=$bs $lofile | _filter_mkfs \ + loop_dev=$(_create_loop_device $testfile) + $MKFS_XFS_PROG -l size=32m -b size=$bs $loop_dev | _filter_mkfs \ >/dev/null 2> $tmp.mkfs || echo "mkfs failed!" . $tmp.mkfs sync - losetup -d $lofile + _destroy_loop_device $loop_dev + unset loop_dev done done diff --git a/tests/xfs/513 b/tests/xfs/513 index 5895e6e2d..0c0edc75e 100755 --- a/tests/xfs/513 +++ b/tests/xfs/513 @@ -15,12 +15,8 @@ _cleanup() cd / rm -f $tmp.* _unmount $LOOP_MNT 2>/dev/null - if [ -n "$LOOP_DEV" ];then - _destroy_loop_device $LOOP_DEV 2>/dev/null - fi - if [ -n "$LOOP_SPARE_DEV" ];then - _destroy_loop_device $LOOP_SPARE_DEV 2>/dev/null - fi + [ -n $loop_dev ] &&_destroy_loop_device $loop_dev + [ -n $loop_spare_dev ] &&_destroy_loop_device $loop_spare_dev rm -f $LOOP_IMG rm -f $LOOP_SPARE_IMG rmdir $LOOP_MNT @@ -42,11 +38,11 @@ LOOP_MNT=$TEST_DIR/$seq.mnt echo "** create loop device" $XFS_IO_PROG -f -c "truncate 32g" $LOOP_IMG -LOOP_DEV=`_create_loop_device $LOOP_IMG` +loop_dev=`_create_loop_device $LOOP_IMG` echo "** create loop log device" $XFS_IO_PROG -f -c "truncate 1g" $LOOP_SPARE_IMG -LOOP_SPARE_DEV=`_create_loop_device $LOOP_SPARE_IMG` +loop_spare_dev=`_create_loop_device $LOOP_SPARE_IMG` echo "** create loop mount point" rmdir $LOOP_MNT 2>/dev/null @@ -55,8 +51,8 @@ mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point" filter_loop() { sed -e "s,\B$LOOP_MNT,LOOP_MNT,g" \ - -e "s,\B$LOOP_DEV,LOOP_DEV,g" \ - -e "s,\B$LOOP_SPARE_DEV,LOOP_SPARE_DEV,g" + -e "s,\B$loop_dev,LOOP_DEV,g" \ + -e "s,\B$loop_spare_dev,LOOP_SPARE_DEV,g" } filter_xfs_opt() @@ -69,22 +65,22 @@ MKFS_OPTIONS="" do_mkfs() { echo "FORMAT: $@" | filter_loop | tee -a $seqres.full - $MKFS_XFS_PROG -f $* $LOOP_DEV | _filter_mkfs >>$seqres.full 2>$tmp.mkfs + $MKFS_XFS_PROG -f $* $loop_dev | _filter_mkfs >>$seqres.full 2>$tmp.mkfs if [ "${PIPESTATUS[0]}" -ne 0 ]; then - _fail "Fails on _mkfs_dev $* $LOOP_DEV" + _fail "Fails on _mkfs_dev $* $loop_dev" fi . $tmp.mkfs } is_dev_mounted() { - findmnt --source $LOOP_DEV >/dev/null + findmnt --source $loop_dev >/dev/null return $? } get_mount_info() { - findmnt --source $LOOP_DEV -o OPTIONS -n + findmnt --source $loop_dev -o OPTIONS -n } force_unmount() @@ -103,29 +99,29 @@ _do_test() local info # mount test - _mount $LOOP_DEV $LOOP_MNT $opts 2>>$seqres.full + _mount $loop_dev $LOOP_MNT $opts 2>>$seqres.full rc=$? if [ $rc -eq 0 ];then if [ "${mounted}" = "fail" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: expect mount to fail, but it succeeded" return 1 fi is_dev_mounted if [ $? -ne 0 ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: fs not mounted even mount return 0" return 1 fi else if [ "${mounted}" = "pass" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: expect mount to succeed, but it failed" return 1 fi is_dev_mounted if [ $? -eq 0 ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: fs is mounted even mount return non-zero" return 1 fi @@ -141,13 +137,13 @@ _do_test() rc=$? if [ $rc -eq 0 ];then if [ "$found" != "true" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: expected to find \"$key\" in mount info \"$info\"" return 1 fi else if [ "$found" != "false" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: did not expect to find \"$key\" in \"$info\"" return 1 fi @@ -253,9 +249,9 @@ do_test "-o logbsize=512k" fail # Test logdev do_mkfs do_test "" pass "logdev" "false" -do_test "-o logdev=$LOOP_SPARE_DEV" fail -do_mkfs -l logdev=$LOOP_SPARE_DEV -do_test "-o logdev=$LOOP_SPARE_DEV" pass "logdev=$LOOP_SPARE_DEV" "true" +do_test "-o logdev=$loop_spare_dev" fail +do_mkfs -l logdev=$loop_spare_dev +do_test "-o logdev=$loop_spare_dev" pass "logdev=$loop_spare_dev" "true" do_test "" fail # Test noalign diff --git a/tests/xfs/521 b/tests/xfs/521 index 13982c440..c92c621a2 100755 --- a/tests/xfs/521 +++ b/tests/xfs/521 @@ -21,7 +21,7 @@ _cleanup() { cd / _scratch_unmount >> $seqres.full 2>&1 - test -e "$rtdev" && losetup -d $rtdev >> $seqres.full 2>&1 + [ -n "$rt_loop_dev" ] && _destroy_loop_device $rt_loop_dev rm -f $tmp.* $TEST_DIR/$seq.rtvol } @@ -35,7 +35,7 @@ _require_no_large_scratch_dev echo "Create fake rt volume" truncate -s 400m $TEST_DIR/$seq.rtvol -rtdev=$(_create_loop_device $TEST_DIR/$seq.rtvol) +rt_loop_dev=$(_create_loop_device $TEST_DIR/$seq.rtvol) echo "Format and mount 100m rt volume" export USE_EXTERNAL=yes @@ -69,6 +69,10 @@ cp -p $testdir/original $testdir/copy3 echo "Check filesystem" _check_scratch_fs +_scratch_unmount +_destroy_loop_device $rt_loop_dev +unset rt_loop_dev + # success, all done status=0 exit diff --git a/tests/xfs/528 b/tests/xfs/528 index 6ca9a2370..a1efbbd27 100755 --- a/tests/xfs/528 +++ b/tests/xfs/528 @@ -15,7 +15,7 @@ _cleanup() { cd / _scratch_unmount >> $seqres.full 2>&1 - test -e "$rtdev" && losetup -d $rtdev >> $seqres.full 2>&1 + [ -n "$rt_loop_dev" ] && _destroy_loop_device $rt_loop_dev rm -f $tmp.* $TEST_DIR/$seq.rtvol } @@ -155,11 +155,11 @@ test_ops() { echo "Create fake rt volume" $XFS_IO_PROG -f -c "truncate 400m" $TEST_DIR/$seq.rtvol -rtdev=$(_create_loop_device $TEST_DIR/$seq.rtvol) +rt_loop_dev=$(_create_loop_device $TEST_DIR/$seq.rtvol) echo "Make sure synth rt volume works" export USE_EXTERNAL=yes -export SCRATCH_RTDEV=$rtdev +export SCRATCH_RTDEV=$rt_loop_dev _scratch_mkfs > $seqres.full _try_scratch_mount || \ _notrun "Could not mount with synthetic rt volume" @@ -170,6 +170,10 @@ test_ops 262144 # not a power of two test_ops 327680 +_scratch_unmount +_destroy_loop_device $rt_loop_dev +unset rt_loop_dev + # success, all done status=0 exit diff --git a/tests/xfs/530 b/tests/xfs/530 index 8a182bd6a..d0d0e2665 100755 --- a/tests/xfs/530 +++ b/tests/xfs/530 @@ -15,7 +15,7 @@ _cleanup() { cd / _scratch_unmount >> $seqres.full 2>&1 - test -e "$rtdev" && losetup -d $rtdev >> $seqres.full 2>&1 + [ -n "$rt_loop_dev" ] && _destroy_loop_device $rt_loop_dev rm -f $tmp.* $TEST_DIR/$seq.rtvol } @@ -52,12 +52,12 @@ fi rtdevsz=$((nr_bits * rtextsz)) truncate -s $rtdevsz $TEST_DIR/$seq.rtvol -rtdev=$(_create_loop_device $TEST_DIR/$seq.rtvol) +rt_loop_dev=$(_create_loop_device $TEST_DIR/$seq.rtvol) echo "Format and mount rt volume" export USE_EXTERNAL=yes -export SCRATCH_RTDEV=$rtdev +export SCRATCH_RTDEV=$rt_loop_dev _scratch_mkfs -d size=$((1024 * 1024 * 1024)) \ -r size=${rtextsz},extsize=${rtextsz} >> $seqres.full _try_scratch_mount || _notrun "Couldn't mount fs with synthetic rt volume" @@ -116,8 +116,9 @@ done echo "Check filesystem" _check_scratch_fs -losetup -d $rtdev -rm -f $TEST_DIR/$seq.rtvol +_scratch_unmount +_destroy_loop_device $rt_loop_dev +unset rt_loop_dev # success, all done status=0 diff --git a/tests/xfs/606 b/tests/xfs/606 index f958bddd8..b537ea145 100755 --- a/tests/xfs/606 +++ b/tests/xfs/606 @@ -13,10 +13,8 @@ _begin_fstest auto quick growfs _cleanup() { - local dev _unmount $LOOP_MNT 2>/dev/null - dev=$(losetup -j testfile | cut -d: -f1) - losetup -d $dev 2>/dev/null + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev rm -rf $LOOP_IMG $LOOP_MNT cd / rm -f $tmp.* @@ -40,7 +38,9 @@ $MKFS_XFS_PROG -f $LOOP_IMG >$seqres.full # Extend by just 8K, expected to start with the last full-size AG ends of # above 1G block device. $XFS_IO_PROG -f -c "truncate 1073750016" $LOOP_IMG -_mount -oloop $LOOP_IMG $LOOP_MNT + +loop_dev=$(_create_loop_device $LOOP_IMG) +_mount $loop_dev $LOOP_MNT # A known bug shows "XFS_IOC_FSGROWFSDATA xfsctl failed: No space left on # device" at here, refer to _fixed_by_kernel_commit above $XFS_GROWFS_PROG $LOOP_MNT >$seqres.full @@ -48,6 +48,10 @@ if [ $? -ne 0 ];then echo "xfs_growfs fails!" fi +_unmount $LOOP_MNT +_destroy_loop_device $loop_dev +unset loop_dev + echo "Silence is golden" # success, all done status=0 diff --git a/tests/xfs/613 b/tests/xfs/613 index 6ba3d87bf..b87cae91e 100755 --- a/tests/xfs/613 +++ b/tests/xfs/613 @@ -15,14 +15,8 @@ _cleanup() cd / rm -f $tmp.* _unmount $LOOP_MNT 2>/dev/null - if [ -n "$LOOP_DEV" ];then - _destroy_loop_device $LOOP_DEV 2>/dev/null - fi - if [ -n "$LOOP_SPARE_DEV" ];then - _destroy_loop_device $LOOP_SPARE_DEV 2>/dev/null - fi + [ -n $loop_dev ] &&_destroy_loop_device $loop_dev rm -f $LOOP_IMG - rm -f $LOOP_SPARE_IMG rmdir $LOOP_MNT } @@ -38,16 +32,11 @@ _require_loop _require_xfs_io_command "falloc" LOOP_IMG=$TEST_DIR/$seq.dev -LOOP_SPARE_IMG=$TEST_DIR/$seq.logdev LOOP_MNT=$TEST_DIR/$seq.mnt echo "** create loop device" $XFS_IO_PROG -f -c "truncate 32g" $LOOP_IMG -LOOP_DEV=`_create_loop_device $LOOP_IMG` - -echo "** create loop log device" -$XFS_IO_PROG -f -c "truncate 1g" $LOOP_SPARE_IMG -LOOP_SPARE_DEV=`_create_loop_device $LOOP_SPARE_IMG` +loop_dev=`_create_loop_device $LOOP_IMG` echo "** create loop mount point" rmdir $LOOP_MNT 2>/dev/null @@ -56,8 +45,7 @@ mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point" filter_loop() { sed -e "s,\B$LOOP_MNT,LOOP_MNT,g" \ - -e "s,\B$LOOP_DEV,LOOP_DEV,g" \ - -e "s,\B$LOOP_SPARE_DEV,LOOP_SPARE_DEV,g" + -e "s,\B$loop_dev,LOOP_DEV,g" } filter_xfs_opt() @@ -70,22 +58,22 @@ MKFS_OPTIONS="" do_mkfs() { echo "FORMAT: $@" | filter_loop | tee -a $seqres.full - $MKFS_XFS_PROG -f $* $LOOP_DEV | _filter_mkfs >>$seqres.full 2>$tmp.mkfs + $MKFS_XFS_PROG -f $* $loop_dev | _filter_mkfs >>$seqres.full 2>$tmp.mkfs if [ "${PIPESTATUS[0]}" -ne 0 ]; then - _fail "Fails on _mkfs_dev $* $LOOP_DEV" + _fail "Fails on _mkfs_dev $* $loop_dev" fi . $tmp.mkfs } is_dev_mounted() { - findmnt --source $LOOP_DEV >/dev/null + findmnt --source $loop_dev >/dev/null return $? } get_mount_info() { - findmnt --source $LOOP_DEV -o OPTIONS -n + findmnt --source $loop_dev -o OPTIONS -n } force_unmount() @@ -104,29 +92,29 @@ _do_test() local info # mount test - _mount $LOOP_DEV $LOOP_MNT $opts 2>>$seqres.full + _mount $loop_dev $LOOP_MNT $opts 2>>$seqres.full rc=$? if [ $rc -eq 0 ];then if [ "${mounted}" = "fail" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: expect mount to fail, but it succeeded" return 1 fi is_dev_mounted if [ $? -ne 0 ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: fs not mounted even mount return 0" return 1 fi else if [ "${mounted}" = "pass" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: expect mount to succeed, but it failed" return 1 fi is_dev_mounted if [ $? -eq 0 ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: fs is mounted even mount return non-zero" return 1 fi @@ -142,13 +130,13 @@ _do_test() rc=$? if [ $rc -eq 0 ];then if [ "$found" != "true" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: expected to find \"$key\" in mount info \"$info\"" return 1 fi else if [ "$found" != "false" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: did not expect to find \"$key\" in \"$info\"" return 1 fi diff --git a/tests/xfs/613.out b/tests/xfs/613.out index 1624617ee..2a693c53c 100644 --- a/tests/xfs/613.out +++ b/tests/xfs/613.out @@ -1,6 +1,5 @@ QA output created by 613 ** create loop device -** create loop log device ** create loop mount point ** start xfs mount testing ... FORMAT: -m crc=0 From patchwork Wed Nov 27 04:51:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886550 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C2BF82D66 for ; Wed, 27 Nov 2024 04:54:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683253; cv=none; b=oO/bVVjt7yh63TTqrep1eK+OTgsotSDGDC5RsaZPxrmXL05XmyCceEEcnWwhHfBvyXwEeXY2gGCg9jF5v72+yg9T5pR5yU3sGMurnnIXsfWrEGKqIVhtlDUGrayL4lUpRBCdEBlTeKmsFB8jubiw9B3rFrKqTOQZ2BSzrRJ27T8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683253; c=relaxed/simple; bh=68NkP28QFySiXfDBAT20X1lUvpZ+TBkmMG1em8hHh1Q=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nYG7vrKWGe5N2KG7zzavcutXX35WQJtdY+9uleDtXaysC1cF8r8Io5tMGxVfEYqCDLodPTA63B6MTd7X8W6F1CvtaAmrWQjLE0CSKtRKCLulIRw7XRf5S/lYYxptZjAdCI5esLvQarWwiNXTpdUobw0Yx9m47tB6aue4Rs5fwZo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=lDjfS1XI; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="lDjfS1XI" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-724e7d5d5b2so4753694b3a.2 for ; Tue, 26 Nov 2024 20:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683251; x=1733288051; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=olPX/8Lis4fpdUAhrxPcDPcOvQk9aHidQcfvBXL3oe4=; b=lDjfS1XIztQKPeXdZDMjy0vJrdlZNsAJGpj5YaZxLLAZw8bSdyuA69jN3iztfzygE6 aRkyYF7wtxNoSMGdkhufAPTnmlHv/5bZSCdntkyXan3hAcOtKcO3jxALZ6bnkviiwn6f uM8KvQSMKod50AKo09y/mqxJgwcpGT9ldG/dRcVkdWzNV/Xm5d2CpZriEeVooEIw+RPh erRAL0mRNcvnEqHiPVoGH/tPvDvZtYjS0Coj70NUjdfDF5bpSe/N1qi13HADxtYYFh8P x+srJUvFy5+xv+HQi9OsWsbrGgUwCu5W2G1KlLvvRDo05BjqlSSqNKOhABEzc1RmM/Dd wYvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683251; x=1733288051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=olPX/8Lis4fpdUAhrxPcDPcOvQk9aHidQcfvBXL3oe4=; b=oPVK5V0BQoUbKZbJe9/3G389RGc3Om0BoXg964Xg5wKGgJxJ3JHca1QKWYFX6pHlXE 3fzPMc+OcOBJV9ai0SFoGLKaaRD3iWE+R/fBQDuHKE/W1WV1W2P9TdxIcfxu1NpOO/Pn sPW0tEmNIFjfrAxomnO7Y5npW7eYzV2jJfK9wtf8gJpZN+nvizcCbrS+F3zaiQvAQnlW sVBWaDIzdRDtkbiUX48XaHWU3jpunNZc3NNhn/ZEZFy3loBawOcysEeXXEB+dUO5Fd+4 TYeVX/MCMNAKOfaBUn7RNGCXgfmSt0NSWTlM6W9z8Z9XGNgPqJVYSx5Rv1B82ajTBm8Q un8Q== X-Gm-Message-State: AOJu0Yy+oCjVuWwo+fxQ+YNYokZ8PdCPrf/JHPS9B2RVcKokVs6C1hp3 RDsbXeBA0SoqkLEtSXCGo6OKHxPf+YvAYW4NFTZYMgQWXu9POvguKMuJ155oxw8IOewf/7+dEsy 7 X-Gm-Gg: ASbGncunnCpT+h7ogK+6J80Ni7yxTrraXXlel2xrR4dA7kOe2RCORjEfl4lOFI9jKtK Ma7FU26ot2ECBD5+D+AT3Q3yp3P/d+IgbQnDnBjjH0/eQJrBrwzQw00clZpZFerGxcVlagFU0zP 5hd/h3uhH4pnsQ1gsmR7eTpE+zjvG+qGyZfTs3/qxsuuKB2O53zBQO14KWg+orV63QAJ3PsCMoq kk1BQ/GzwXVjqwTDN8C4ztjhoKHawvY5MuSNFY/P2RP/zRAxWvOZ1pp2ApT5APvw/mzH3eKYWzu ww15bXGazFzoScKgqlnlsaG+ X-Google-Smtp-Source: AGHT+IEqkmVldW26EpEPMYAbquREs54RLidqG9A4NjE9Vm52g8s0Ghpo1wAmZClj2YRwkNh93X38xg== X-Received: by 2002:a05:6a20:734a:b0:1d9:4837:ada2 with SMTP id adf61e73a8af0-1e0e0b7e3a4mr2634443637.35.1732683251603; Tue, 26 Nov 2024 20:54:11 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724eb65d2adsm8221655b3a.159.2024.11.26.20.54.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:09 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZUi-11xw for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQeY-1Y5g for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 14/40] fstests: xfs/227 is really slow Date: Wed, 27 Nov 2024 15:51:44 +1100 Message-ID: <20241127045403.3665299-15-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner The slowest test tto run on my test VMs is xfs/227: ... xfs/227 826 ... It is doing nested iteration on created filesets that are explicitly defined, so separate the inner loop filesets and run the outer loops in parallel. Also reduce the number of times we have to execute setfattr and xfs_io to once per created file instead of once per xattr/extent count per file. The result is test runtime reduction of ~60%. .... xfs/227 336 .... Signed-off-by: Dave Chinner --- tests/xfs/227 | 57 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/tests/xfs/227 b/tests/xfs/227 index 2ad910cbd..7f8ee2dba 100755 --- a/tests/xfs/227 +++ b/tests/xfs/227 @@ -41,7 +41,7 @@ fragment_freespace() # allocate inode space mkdir -p $_dir for i in `seq 0 1 1000`; do - touch $_file.$i + echo -n > $_file.$i done for i in `seq 0 63 1000`; do mv $_file.$i $_dir @@ -68,19 +68,23 @@ fragment_freespace() create_attrs() { - for foo in `seq 0 1 $1`; do - $SETFATTR_PROG -n user.$foo -v 0xbabe $2 - done + ( echo "# file: $2" + for i in `seq 0 1 $1`; do + echo "user.$foo=\"0xbabe\"" + done ) > $tmp.$1.attrs + $SETFATTR_PROG --restore=$tmp.$1.attrs $2 } create_data() { - size=`expr \( $1 + 1 \) \* 4096` - $XFS_IO_PROG -f -c "truncate $size" $2 > /dev/null 2>&1 - for foo in `seq $1 -1 0`; do - let offset=$foo*4096 - $XFS_IO_PROG -f -c "resvsp $offset 4096" $2 > /dev/null 2>&1 + local blocks=$1 + local cmd_str + + for off in `seq $blocks -1 0`; do + cmd_str="-c \"resvsp $((off * 4096)) 4096\" $cmd_str" done + $XFS_IO_PROG -f -c "truncate $((($blocks + 1) * 4096))" \ + $cmd_str $2 >> seqres.full 2>&1 } # create the designated file with a certain number of attributes and a certain @@ -119,6 +123,27 @@ create_target_attr_last() create_attrs $nattrs $target } +do_fsr() +{ + local n=$1 + local i=$2 + local j + + for j in `seq 5 1 20`; do + create_target_attr_first $i $j $targ.$i.$j >> $seqres.full 2>&1 + done + xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 + FSRXFSTEST=true xfs_fsr -d -v -C $n $targ.$i.* >> $seqres.full 2>&1 + xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 + for j in `seq 5 1 20`; do + create_target_attr_last $i $j $targ.$i.$j >> $seqres.full 2>&1 + done + xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 + FSRXFSTEST=true xfs_fsr -d -v -C $n $targ.$i.* >> $seqres.full 2>&1 + xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 +} + + # use a small filesystem so we can control freespace easily _scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 _scratch_mount @@ -154,19 +179,9 @@ targ=$SCRATCH_MNT/fsr_test_file.$$ for n in `seq 4 1 12`; do echo "*** n == $n ***" >> $seqres.full for i in `seq 5 1 15`; do - for j in `seq 5 1 20`; do - create_target_attr_first $i $j $targ.$i.$j >> $seqres.full 2>&1 - done - xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 - FSRXFSTEST=true xfs_fsr -d -v -C $n $targ.$i.* >> $seqres.full 2>&1 - xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 - for j in `seq 5 1 20`; do - create_target_attr_last $i $j $targ.$i.$j >> $seqres.full 2>&1 - done - xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 - FSRXFSTEST=true xfs_fsr -d -v -C $n $targ.$i.* >> $seqres.full 2>&1 - xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 + do_fsr $n $i & done + wait done _scratch_unmount From patchwork Wed Nov 27 04:51:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886568 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 581064689 for ; Wed, 27 Nov 2024 04:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683575; cv=none; b=HeW620hBodK5E1v3xoybOmDkmP9Md5jZicMUakBxI0gjhOY6jcmcRDt8oDRm3wmAhhDfjHsUB9IfUplC5tlBxQ9xXSzXR9t7Rv/9Qp1jbKzwabNgtyrvAefXwdyasYVIIpkwjVRFNo94osC3IdzD2QDIYatQ1Rc2Dtsfi8x5Ms0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683575; c=relaxed/simple; bh=DaCViSDIr7o1A1Ht2B1KOho7iAv1rY1kA+Ru9raJy0U=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dqLleLvSVtO+ivZaNxkOYfdDkxbdAnOkVy78tB2V48vHuwFolYeDwQfZt523s11nzGVb0gKCehReEEhcWoOPv5JZtv4NYAUJzdYQTMX1jwuOhthIE6Va3T8gfvKcdtOaXjapnCdiAWqOdZsnrB3t3EBN2IQdWLCymeg7ZSb5Mxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=MdowxnAM; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="MdowxnAM" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2129fd7b1a5so46171625ad.1 for ; Tue, 26 Nov 2024 20:59:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683573; x=1733288373; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=mP1rPRAm2d8Rm2qsU6tCPjcunzd1eoaQlBXhUvC0uGo=; b=MdowxnAMPNAVAe19mIUUEWXF6yAxW/hvvbXMsHByiUg1ZuzFxhpaC0Ul1rWWsSWEm2 NcUFu9Kd7nFe8A6ma41r0Udj0joKFo27GnvQ6HCJWbjYhr2YOIPZ0N+ErDH8lOdY9sKc RMfKJOG3RV6Z5AInSTuacSO3STw5JIxtEtOhJEQPnaCHGmlsHoO1B3sM/GnDIMEVRYxo 6V026/ah5/757psgFUkiI0g6YsaXJ7Y8n4nyfqjQWRdQO7KiALp5190eWTL9fmdn8XAm ZDANNssCWqFFdrXbzIkkT2Y7E3pyfniXAwPDtngqIku4j013Do0FRlWQZyZMoXjP3kmY bUVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683573; x=1733288373; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mP1rPRAm2d8Rm2qsU6tCPjcunzd1eoaQlBXhUvC0uGo=; b=C077HB4g3rEpLNlb6aQzKkrmhWnjYWGVLBv1m3zNtxdE01bIJ0hmOGiPVauCc991vJ C2YkLsC2sojihgd8UDZu5LxS6j8Eymhw72/YLA+w+vnVCjYE2kPyFUx3Lzoa2yfuMHQl vAq8s66Yh2qm48epN4QnKZ/4kMJS1GRmgW364H8WM/15u9tywjiP/RIq20zKc7M6l3Cd Q4wbONR0Gil8t8wA8mhQ0ELWruRvmMcIpK4Q5M64Jf/Wu4+2gz3l7nKIbzd4YQEamnqb mHsbjq44PUER6Ku8+rWqSkpsx9Otj7+791bvH1A6EQcBN3ScB2HwopHcxdVqnMuz3+hD xE2w== X-Gm-Message-State: AOJu0Yx+WNA3QyO3VDKJeaMAxo6cwf9CrymRgRyov8QdTU8ZhjjGm7zU V9nGeI25v/SDl32KDOuFXP1f3p2muYEtfdvtmVl9j4rHSpV8v9ZxW5DjCNNf0ZmBy9pm4GKz6+S W X-Gm-Gg: ASbGncuyprk3LI/E3pStTaAnLMPiFAM8CO8AzEk+arzkCmRX5Gy0ueh9FOtiJKvxxtP EOWO1pK6yOIRmtwkv8skkP7Ghd2fGqU9su+vtOwXFW91vEzmqE8bXlK9nt48vdG7mGhMYRkJ1Oo /Hfp3AO98pcb25xT3UXB4p0UM7PXa8d5fXXyqz6AKu2W5OHNPWZr8zgK6LMYMK8nYaLhcuMcsid F370y6OePS0NQ7HywblwFnsxXNDM/qW52Wonrq7HTc3nLlXqVo5eJEkUlXV3jv6vro3xJ3wHHOC b4cC+EOCWWcYhg== X-Google-Smtp-Source: AGHT+IHmJRpO5vNi8gCCjg4XFLPyOpKMhfn5fUx+AwFBNdU9uQGayWRSQBvFCyq0Yk8HRKRltjmESQ== X-Received: by 2002:a17:903:22d0:b0:212:5ee0:1249 with SMTP id d9443c01a7336-21501e5c253mr24772515ad.40.1732683572635; Tue, 26 Nov 2024 20:59:32 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dc131f3sm91428235ad.200.2024.11.26.20.59.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:32 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZUn-1EQT for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQef-1k3T for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 15/40] fstests: mark tests that are unreliable when run in parallel Date: Wed, 27 Nov 2024 15:51:45 +1100 Message-ID: <20241127045403.3665299-16-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Add a group named "unreliable_in_parallel" to mark tests that do not give reliable results when multiple tests are run in parallel. Generally this happens with tests that are reliant on caching in some way, such as generating specific file layouts using buffered IO or expecting inodes to be cached in memory. These are perturbed by other tests running sync(), generating memory pressure, dropping caches, etc. Hence whether these tests pass or fail is wholly dependent on what tests are running at the same time, and hence randomly fail when nothing has actually gone wrong. Hence they are unreliable as regression tests when running tests in parallel, so we add them to the "unreliable_in_parallel" group and a parallel check can exclude this group. As tests are updated to be robust against external interference, they can be removed from the unreliable_in_parallel group. Signed-off-by: Dave Chinner --- doc/group-names.txt | 1 + tests/generic/336 | 7 ++++++- tests/generic/561 | 8 +++++++- tests/xfs/177 | 8 ++++++-- tests/xfs/232 | 6 +++++- tests/xfs/237 | 8 +++++++- tests/xfs/243 | 7 +++++-- tests/xfs/300 | 8 ++++++-- tests/xfs/440 | 6 +++++- tests/xfs/527 | 5 ++++- tests/xfs/631 | 7 ++++++- tests/xfs/802 | 7 ++++++- 12 files changed, 64 insertions(+), 14 deletions(-) diff --git a/doc/group-names.txt b/doc/group-names.txt index ed886caac..f5bf79a56 100644 --- a/doc/group-names.txt +++ b/doc/group-names.txt @@ -138,6 +138,7 @@ trim FITRIM ioctl udf UDF functionality tests union tests from the unionmount test suite unlink O_TMPFILE unlinked files +unreliable_in_parallel randomly fail when run in parallel with other tests unshare fallocate FALLOC_FL_UNSHARE_RANGE v2log XFS v2 log format tests verity fsverity diff --git a/tests/generic/336 b/tests/generic/336 index 06391a93f..c874997e4 100755 --- a/tests/generic/336 +++ b/tests/generic/336 @@ -9,8 +9,13 @@ # file F2 from directory B into directory C, fsync inode F1, power fail and # remount the filesystem, file F2 exists and is located only in directory C. # + +# unreliable_in_parallel: external sync operations can change what is synced to +# the log before the flakey device drops writes. hence post-remount file +# contents can be different to what the test expects. + . ./common/preamble -_begin_fstest auto quick metadata log +_begin_fstest auto quick metadata log unreliable_in_parallel # Override the default cleanup function. _cleanup() diff --git a/tests/generic/561 b/tests/generic/561 index 3e931b1a7..602c235bc 100755 --- a/tests/generic/561 +++ b/tests/generic/561 @@ -7,8 +7,14 @@ # Dedup & random I/O race test, do multi-threads fsstress and dedupe on # same directory/files # + +# unreliable_in_parallel: duperemove is buggy. It can get stuck in endless +# fiemap mapping loops, and this seems to happen a *lot* when the system is +# under heavy load. when they do this, they don't die when they are supposed to +# and so have to be manually killed to end the test. + . ./common/preamble -_begin_fstest auto stress dedupe +_begin_fstest auto stress dedupe unreliable_in_parallel # Override the default cleanup function. _cleanup() diff --git a/tests/xfs/177 b/tests/xfs/177 index 773049524..22719ba1c 100755 --- a/tests/xfs/177 +++ b/tests/xfs/177 @@ -21,9 +21,13 @@ # Regrettably, there is no way to poke /only/ XFS inode reclamation directly, # so we're stuck with setting xfssyncd_centisecs to a low value and sleeping # while watching the internal inode cache counters. -# + +# unreliable_in_parallel: cache residency is affected by external drop caches +# operations. Hence counting inodes "in cache" often does not reflect what the +# test has actually done. + . ./common/preamble -_begin_fstest auto ioctl +_begin_fstest auto ioctl unreliable_in_parallel _cleanup() { diff --git a/tests/xfs/232 b/tests/xfs/232 index 0eea2c098..f0f3916e7 100755 --- a/tests/xfs/232 +++ b/tests/xfs/232 @@ -12,8 +12,12 @@ # - Wait for the reclaim to run. # - Write more and see how bad fragmentation is. # + +# unreliable_in_parallel: external sync operations affect what happens while +# the test is waiting for COW expiration. + . ./common/preamble -_begin_fstest auto quick clone fiemap prealloc +_begin_fstest auto quick clone fiemap prealloc unreliable_in_parallel # Override the default cleanup function. _cleanup() diff --git a/tests/xfs/237 b/tests/xfs/237 index f172aaf59..91f56d6c1 100755 --- a/tests/xfs/237 +++ b/tests/xfs/237 @@ -6,8 +6,14 @@ # # Test AIO DIO CoW behavior when the write temporarily fails. # + +# unreliable_in_parallel: external drop caches can co-incide with the error +# table being loaded, so the test being run fails with EIO trying to load the +# inode from disk instead of whatever operation it is supposed to fail on when +# the inode is already cached in memory. + . ./common/preamble -_begin_fstest auto quick clone eio +_begin_fstest auto quick clone eio unreliable_in_parallel # Override the default cleanup function. _cleanup() diff --git a/tests/xfs/243 b/tests/xfs/243 index 964e94e1d..f9cc2d50f 100755 --- a/tests/xfs/243 +++ b/tests/xfs/243 @@ -15,9 +15,12 @@ # 5. delalloc # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. -# + +# unreliable_in_parallel: external sync can affect the layout of the files being +# created, results in unreliable detection of delalloc extents. + . ./common/preamble -_begin_fstest auto quick clone punch prealloc +_begin_fstest auto quick clone punch prealloc unreliable_in_parallel # Import common functions. . ./common/filter diff --git a/tests/xfs/300 b/tests/xfs/300 index 3f0dbb9ac..c4c3b1ab8 100755 --- a/tests/xfs/300 +++ b/tests/xfs/300 @@ -5,9 +5,13 @@ # FS QA Test No. 300 # # Test xfs_fsr / exchangerange management of di_forkoff w/ selinux -# + +# unreliable_in_parallel: file layout appears to be perturbed by load related +# timing issues. Not 100% sure, but the backwards write does not reliably +# fragment the source file under heavy external load + . ./common/preamble -_begin_fstest auto fsr +_begin_fstest auto fsr unreliable_in_parallel # Import common functions. . ./common/filter diff --git a/tests/xfs/440 b/tests/xfs/440 index 0cc679aeb..c0b6756ba 100755 --- a/tests/xfs/440 +++ b/tests/xfs/440 @@ -8,8 +8,12 @@ # a file that has CoW reservations and no dirty pages. The reservations # should shift over to the new owner, but they do not. # + +# unreliable_in_parallel: external sync(1) and/or drop caches can reclaim inodes +# and free post-eof space, resulting in lower than expected block counts. + . ./common/preamble -_begin_fstest auto quick clone quota +_begin_fstest auto quick clone quota unreliable_in_parallel # Import common functions. . ./common/reflink diff --git a/tests/xfs/527 b/tests/xfs/527 index 2ef428c25..0d06b128c 100755 --- a/tests/xfs/527 +++ b/tests/xfs/527 @@ -14,8 +14,11 @@ # xfs: fix incorrect root dquot corruption error when switching group/project # quota types +# unreliable_in_parallel: dmesg check can pick up corruptions from other tests. +# Need to filter corruption reports by short scratch dev name. + . ./common/preamble -_begin_fstest auto quick quota +_begin_fstest auto quick quota unreliable_in_parallel # Import common functions. . ./common/quota diff --git a/tests/xfs/631 b/tests/xfs/631 index 4d79b821f..319995f81 100755 --- a/tests/xfs/631 +++ b/tests/xfs/631 @@ -7,8 +7,13 @@ # Post-EOF preallocation defeat test for direct I/O with extent size hints. # +# unreliable_in_parallel: external cache drops can result in the extent size +# being truncated as the inode is evicted from cache between writes. This can +# increase the number of extents significantly beyond what would be expected +# from the extent size hint. + . ./common/preamble -_begin_fstest auto quick prealloc rw +_begin_fstest auto quick prealloc rw unreliable_in_parallel . ./common/filter diff --git a/tests/xfs/802 b/tests/xfs/802 index ea09817fd..fc4767acb 100755 --- a/tests/xfs/802 +++ b/tests/xfs/802 @@ -8,8 +8,13 @@ # filesystem, and that we can read the health reports after the fact. IOWs, # this is basic testing for the systemd background services. # + +# unreliable_in_parallel: this appears to try to run scrub services on all +# mounted filesystems - that's aproblem when there are a hundred other test +# filesystems mounted running other tests... + . ./common/preamble -_begin_fstest auto scrub +_begin_fstest auto scrub unreliable_in_parallel _cleanup() { From patchwork Wed Nov 27 04:51:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886566 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7121E4689 for ; Wed, 27 Nov 2024 04:59:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683569; cv=none; b=SSUfWMelYmqgODeavEw2qaK9IyHJe7WLXSjb76n1laEozWfgb23k3ggnfN32xedhslEn9jDcOtuAjFI36hjC6fPWa9AXeLGjdSTK7TVRK9GLXF2a+mopVbXoV7NjTkTGloDppFGycqCclOE7dMdB0Xmalpo8b6fbIvc9Qv7/v9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683569; c=relaxed/simple; bh=hoUyhGZ3dEP6UU2SOVVtCF3Uzsj2Uyy/tRqRhwYGol4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KVfudHzLcyvpIhsvIzMEb9P9ipl/iaUeLBlgHS0MgAKdUkCVi1ayIj3tJ/pEj+kfSzSG79PLjJmDZGIfCWfU74z1NtdxhSxPI/CsCTZUIJtd/r8gUizSoQNA3JOJK/yePbriEDlxgqMFCeaPX9gK2sEyjiYFna6I9uzDBBD7VyY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=jnlEas55; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="jnlEas55" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-723f37dd76cso6252480b3a.0 for ; Tue, 26 Nov 2024 20:59:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683566; x=1733288366; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=OsbHLOgvrvxHz7aOM9wuCQbYRzWapgwkUHVG3eVzOPc=; b=jnlEas55DMICriCXShkJXe09+7+KOBzFYNxL1o1reUThsHEnYoQ4ybUG0hZrv3zbzG 44ArjXlZ2WCGPPfklfv9v+YOvDOANh0mBfNMZmmSk27YJswVB9QCy6ozb7avFm0k+VTw TJkSiNFLCA73FUP6YyxDsSCk+1D5vIFnmCzQFz4WMfZ3hRtPO+WKk7PGw/P6Ifdzta0c muAPT/DngpPJSVgFD4dh75gCN9104+e49M0xw5t8uQhi1WlO+mFMxMPn0vHKBuX9I6UO QHYBEEOmDNKcpz1pU3fzTOXaWAsP6kocj40Pe+6LaEZGF8376irnO8JGvJ9YzT3Lrn/j p/6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683566; x=1733288366; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OsbHLOgvrvxHz7aOM9wuCQbYRzWapgwkUHVG3eVzOPc=; b=adQD0jILdd/hapwqijN2enI92kqJOEHH9nWZRzNv4FBzMg/vT1Ci3upnoKl57FYhZJ +blyeIf1V/zDZG1wR+1470BeYeG8H7mg24pHOVZ2Z0zCZ7CsZZXgkKyandC+RezpSv1W DKX1VSsBH6y38kgmpdKPAAqtYK9enO5VreFS3lu5ngOWXZClRct1hDkPdbV1f1H9yu2n OHwNl2efZoBCvCrEXEutIonxAIQobAQ9ap/kNakusLLIEkckLMA+xbPM1w1nK9qp9/0C BAyxz0hOmvVzCFjBWivO5x2cb3IRCEQ7sHPwy69P3XHiAnpr+v3fF9iy6n0yY75XAXtZ VPNQ== X-Gm-Message-State: AOJu0YwkCo1BskCLkwA39WA1vmKsieRSxMt3kOFSGtGlSeC1F5w7IxHF DgmMkjflqla88RMarIvkm9GQR5c5XUz3CU7buaOuUFuICAz1MItwvmxVBmK9wM/f8kVqrXZC0gx r X-Gm-Gg: ASbGncth8iZYF/2ov6ntiAAuXpsEds9aHbwJEdQKZx5X8yJ+T5RNBVZF+B64CBSII6y Az2rK2REK3HvGmrswVRDyKIgBI8eoidrUwc2ULkj3K+SJhfUsJU9GwHsXXK1MsTVRvomkfqbcE8 bQSIcvpgpxMsEHKAIsPwPpSe4zLoyGEeA9FfWnb7Em6Jk0Nc3a6ggp6Y6aDwmULYkJlttGoF+Qj Kt73kBux3Q+nJEHIotTyDwB425UBDOs0zMOQPFDHmfYurkWJoNBD2kyiQOCWhsiUlyR6e1ig7ru wdhtzHmYCKF/nw== X-Google-Smtp-Source: AGHT+IF0WTSriABadVi/+yLK3ImrM2hL95JtSv8pUlKQ88KEyvh0oJbNWkak0yzhlDDBfcInqPzDLA== X-Received: by 2002:a05:6a20:430f:b0:1d9:2705:699e with SMTP id adf61e73a8af0-1e0e0ac3139mr3359447637.7.1732683565614; Tue, 26 Nov 2024 20:59:25 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee0fab815csm490563a91.48.2024.11.26.20.59.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:25 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZUq-1NHN for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQek-1wAi for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 16/40] fstests: use udevadm wait in preference to settle Date: Wed, 27 Nov 2024 15:51:46 +1100 Message-ID: <20241127045403.3665299-17-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner When running lots of tests in parallel, there are lots of filesystems and block devices changing state. This generates a lot of udev events when means the udev event queue is rarely empty. Unfortunately, an empty event queue is what udev settling waits upon. Hence calling UDEV_SETTLE_PROG can mean waiting for a lot of time for other tests to stop generating udev events. For the majority of cases, what we care about is that udev has performed device node addition or removal, not that there are no udev events pending. Recent(-ish) systemd releases support 'udevadm wait' to wait for a specific file to be created or unlinked rather than waiting for the event that does that work to be completed. Hence we don't have to wait for the udev event queue to empty, just for the udev event that does the device node manipulation to complete. Introduce detection of 'udevadm wait' support and a _udev_wait() wrapper function to use it if it is available. If it isn't, the use the existing UDEV_SETTLE_PROG behaviour. Signed-off-by: Dave Chinner --- common/config | 35 +++++++++++++++++++++++++---------- common/rc | 25 ++++++++++++++++--------- tests/btrfs/291 | 5 +++-- tests/generic/081 | 6 +++--- tests/generic/108 | 7 +++---- tests/generic/459 | 6 +++--- 6 files changed, 53 insertions(+), 31 deletions(-) diff --git a/common/config b/common/config index fcff0660b..41b8f29d1 100644 --- a/common/config +++ b/common/config @@ -165,7 +165,7 @@ export XFS_MDRESTORE_PROG="$(type -P xfs_mdrestore)" export XFS_ADMIN_PROG="$(type -P xfs_admin)" export XFS_GROWFS_PROG=$(type -P xfs_growfs) export XFS_SPACEMAN_PROG="$(type -P xfs_spaceman)" -export XFS_SCRUB_PROG="$(type -P xfs_scrub)" +#export XFS_SCRUB_PROG="$(type -P xfs_scrub)" export XFS_PARALLEL_REPAIR_PROG="$(type -P xfs_prepair)" export XFS_PARALLEL_REPAIR64_PROG="$(type -P xfs_prepair64)" export __XFSDUMP_PROG="$(type -P xfsdump)" @@ -236,18 +236,30 @@ export BTRFS_MAP_LOGICAL_PROG=$(type -P btrfs-map-logical) export PARTED_PROG="$(type -P parted)" export XFS_PROPERTY_PROG="$(type -P xfs_property)" -# use 'udevadm settle' or 'udevsettle' to wait for lv to be settled. -# newer systems have udevadm command but older systems like RHEL5 don't. -# But if neither one is available, just set it to "sleep 1" to wait for lv to -# be settled -UDEV_SETTLE_PROG="$(type -P udevadm)" -if [ "$UDEV_SETTLE_PROG" == "" ]; then - # try udevsettle command +# udev wait functions. +# +# This is how we wait for udev to create or remove device nodes after running a +# device create/remove command for logical volumes (e.g. lvm or dm). +# +# We can wait for the udev queue to empty via "settling". This, however, has +# major issues when running tests in parallel - the udev queue takes a long time +# to reach empty state. Hence if we have udev > 2.51 installed we use device +# waiting instead. This waits for the device node to appear/disappear rather +# than waiting for the udev queue to empty. +# +# If none of these methods are available, fall back to a simple delay (sleep 1) +# and hope this is sufficient. +UDEVADM_PROG="$(type -P udevadm)" +if [ -z "$UDEVADM_PROG" ]; then UDEV_SETTLE_PROG="$(type -P udevsettle)" else - # udevadm is available, add 'settle' as subcommand - UDEV_SETTLE_PROG="$UDEV_SETTLE_PROG settle" + UDEV_SETTLE_PROG="$UDEVADM_PROG settle" + $UDEVADM_PROG help | grep -q "Wait for device or device symlink" + if [ $? -eq 0 ]; then + UDEV_WAIT_PROG="$UDEVADM_PROG wait" + fi fi + # neither command is available, use sleep 1 # # Udev events are sent via netlink to userspace through @@ -258,8 +270,11 @@ fi # exist or always be 0. We check for /proc/net to see CONFIG_NET was enabled. if [[ "$UDEV_SETTLE_PROG" == "" || ! -d /proc/net ]]; then UDEV_SETTLE_PROG="sleep 1" + unset UDEV_WAIT_PROG fi export UDEV_SETTLE_PROG +export UDEVADM_PROG +export UDEV_WAIT_PROG # Set MODPROBE_PATIENT_RM_TIMEOUT_SECONDS to "forever" if you want the patient # modprobe removal to run forever trying to remove a module. diff --git a/common/rc b/common/rc index 3f35da7fe..fdd18a386 100644 --- a/common/rc +++ b/common/rc @@ -5191,22 +5191,29 @@ _require_label_get_max() dummy=$(_label_get_max) } +_udev_wait() +{ + local args="$*" + + if [ -z "$UDEV_WAIT_PROG" ]; then + $UDEV_SETTLE_PROG >/dev/null 2>&1 + else + $UDEV_WAIT_PROG $args + fi +} + _dmsetup_remove() { - $UDEV_SETTLE_PROG >/dev/null 2>&1 - $DMSETUP_PROG remove --retry "$@" >>$seqres.full 2>&1 - $UDEV_SETTLE_PROG >/dev/null 2>&1 + [ $# -le 0 ] && return + + $DMSETUP_PROG remove --deferred "$@" >>$seqres.full 2>&1 + _udev_wait --removed /dev/mapper/$1 } _dmsetup_create() { - # Wait for udev to settle so that the dm creation doesn't fail because - # some udev subprogram opened one of the block devices mentioned in the - # table string w/ O_EXCL. Do it again at the end so that an immediate - # device open won't also fail. - $UDEV_SETTLE_PROG >/dev/null 2>&1 $DMSETUP_PROG create "$@" >>$seqres.full 2>&1 || return 1 - $UDEV_SETTLE_PROG >/dev/null 2>&1 + _udev_wait /dev/mapper/$1 } _require_btime() diff --git a/tests/btrfs/291 b/tests/btrfs/291 index c31de3a96..122aeaa5d 100755 --- a/tests/btrfs/291 +++ b/tests/btrfs/291 @@ -21,6 +21,7 @@ _cleanup() cd / _log_writes_cleanup &> /dev/null $LVM_PROG vgremove -f -y $vgname >>$seqres.full 2>&1 + _udev_wait --removed /dev/mapper/$vgname-$lvname losetup -d $loop_dev >>$seqres.full 2>&1 rm -f $img _restore_fsverity_signatures @@ -106,7 +107,7 @@ snap_dev=/dev/mapper/vg_replay-$snapname $LVM_PROG vgcreate -f $vgname $loop_dev >>$seqres.full 2>&1 || _fail "failed to vgcreate $vgname" $LVM_PROG lvcreate -L "$replay_bytes"B -n $lvname $vgname -y >>$seqres.full 2>&1 || \ _fail "failed to lvcreate $lvname" -$UDEV_SETTLE_PROG >>$seqres.full 2>&1 +_udev_wait /dev/mapper/$vgname-$lvname replay_log_prog=$here/src/log-writes/replay-log num_entries=$($replay_log_prog --log $LOGWRITES_DEV --num-entries) @@ -125,7 +126,7 @@ do $LVM_PROG lvcreate -s -L 4M -n $snapname $vgname/$lvname >>$seqres.full 2>&1 || \ _fail "Failed to create snapshot" - $UDEV_SETTLE_PROG >>$seqres.full 2>&1 + _udev_wait /dev/mapper/$vgname-$snapname orphan=$(count_item $snap_dev ORPHAN) [ $state -eq 0 ] && [ $orphan -gt 0 ] && state=1 diff --git a/tests/generic/081 b/tests/generic/081 index df17ab6c1..37137d937 100755 --- a/tests/generic/081 +++ b/tests/generic/081 @@ -38,7 +38,7 @@ _cleanup() $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1 $LVM_PROG pvremove -f $SCRATCH_DEV >>$seqres.full 2>&1 pv_ret=$? - $UDEV_SETTLE_PROG + _udev_wait --removed /dev/mapper/$vgname-$lvname test $pv_ret -eq 0 && break sleep 2 done @@ -70,8 +70,8 @@ $LVM_PROG vgcreate -f $vgname $SCRATCH_DEV >>$seqres.full 2>&1 # We use yes pipe instead of 'lvcreate --yes' because old version of lvm # (like 2.02.95 in RHEL6) don't support --yes option yes | $LVM_PROG lvcreate -L ${lvsize}M -n $lvname $vgname >>$seqres.full 2>&1 -# wait for lvcreation to fully complete -$UDEV_SETTLE_PROG >>$seqres.full 2>&1 +_udev_wait /dev/mapper/$vgname-$lvname + # _mkfs_dev exits the test on failure, this can make sure lv is created in # above vgcreate/lvcreate steps diff --git a/tests/generic/108 b/tests/generic/108 index 2709472f6..f630450ec 100755 --- a/tests/generic/108 +++ b/tests/generic/108 @@ -20,8 +20,8 @@ _cleanup() echo running > /sys/block/`_short_dev $SCSI_DEBUG_DEV`/device/state _unmount $SCRATCH_MNT >>$seqres.full 2>&1 $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1 - $LVM_PROG pvremove -f $SCRATCH_DEV $SCSI_DEBUG_DEV >>$seqres.full 2>&1 - $UDEV_SETTLE_PROG + pvremove -f $SCRATCH_DEV $SCSI_DEBUG_DEV >>$seqres.full 2>&1 + _udev_wait --removed /dev/mapper/$vgname-$lvname _put_scsi_debug_dev rm -f $tmp.* } @@ -57,8 +57,7 @@ $LVM_PROG vgcreate -f $vgname $SCSI_DEBUG_DEV $SCRATCH_DEV >>$seqres.full 2>&1 # (like 2.02.95 in RHEL6) don't support --yes option yes | $LVM_PROG lvcreate -i 2 -I 4m -L ${lvsize}m -n $lvname $vgname \ >>$seqres.full 2>&1 -# wait for lv creation to fully complete -$UDEV_SETTLE_PROG >>$seqres.full 2>&1 +_udev_wait /dev/mapper/$vgname-$lvname # _mkfs_dev exits the test on failure, this makes sure test lv is created by # above vgcreate/lvcreate operations diff --git a/tests/generic/459 b/tests/generic/459 index daccc80ce..1986c2e8f 100755 --- a/tests/generic/459 +++ b/tests/generic/459 @@ -31,7 +31,7 @@ _cleanup() _unmount $SCRATCH_MNT >>$seqres.full 2>&1 $LVM_PROG vgremove -ff $vgname >>$seqres.full 2>&1 $LVM_PROG pvremove -ff $SCRATCH_DEV >>$seqres.full 2>&1 - $UDEV_SETTLE_PROG + _udev_wait --removed /dev/mapper/$vgname-$lvname } # Import common functions. @@ -88,8 +88,7 @@ $LVM_PROG lvcreate --thinpool $poolname --errorwhenfull y \ $LVM_PROG lvcreate --virtualsize $virtsize \ -T $vgname/$poolname \ -n $lvname >>$seqres.full 2>&1 - -$UDEV_SETTLE_PROG &>/dev/null +_udev_wait /dev/mapper/$vgname-$lvname _mkfs_dev /dev/mapper/$vgname-$lvname >>$seqres.full 2>&1 # Running the test over the original volume doesn't reproduce the problem @@ -97,6 +96,7 @@ _mkfs_dev /dev/mapper/$vgname-$lvname >>$seqres.full 2>&1 # reproducible, so, create a snapshot and run the test over it. $LVM_PROG lvcreate -k n -s $vgname/$lvname \ -n $snapname >>$seqres.full 2>&1 +_udev_wait /dev/mapper/$vgname-$snapname # Catch mount failure so we don't blindly go an freeze the root filesystem # instead of lvm volume. From patchwork Wed Nov 27 04:51:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886575 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE2344689 for ; Wed, 27 Nov 2024 04:59:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683599; cv=none; b=aamhRZsYFtzleIA9CM7vQ9x5E/WT2uHfVuDn22Yw+cuW9a/8UAcymh07cm4FazkOwiXnDLowHSWVgcGUw6Lu8GTcRrYapmOAqpKwWkDUXLMZedZmNP9Jm9W/WK3e+TLe3xrGPOAl/SDGHni1xiOQiggNh3VV+PQZqQMymzlftis= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683599; c=relaxed/simple; bh=Rnjevz6/P2vRV4yIlfNJs0Wj4xrAQdh4gXrfKgTACmE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bBTl1NTfOVaHi4pwA3UJnkumIWQBqdH4GaslpTbuCRjnitIZnDw6E3qZ5VR5HnhF/+njXKzvtqWl3xE62rjxKDxq1X09NN71bH2WzO4OEg4hw/x1TYQaZV7LYJ1N0cyzZ25DYqaEqUE7L6qFnXE8wKsmRxc0GJEil8/KFqZRPNA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=CIyF3Du9; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="CIyF3Du9" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-7ea9739647bso5020093a12.0 for ; Tue, 26 Nov 2024 20:59:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683597; x=1733288397; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=utZlEfz+5dQ67HxxRHCS5IF8SSWsM/ZWS2gS45Zg7cI=; b=CIyF3Du9t409bdKkEsrtN473xhcmy84ejMGkw4zL6Bb0338ABIy4nkieHIiZPVjfpg zrvOtotFLRIworvZszPWn76uIHvHotDQGe+VeLzUbL5YOntH39l8DbVx3XbNlqdz2duv bJrdvOmAEDcHKzWzuK+NYxQZuxS7knrwyMdIC/17gpPJ7RurSOYuyUKZ8nn2zzfVKXVR Vu4EDf+2ZfPUO1dPvJY+ZghYBErGQiCWV/Kb/3RyTfWXw4JwJei4UJ+/SD7fyjvsPocp zVdCWpbUZH0RtA0a3QEIkpogjvr6s6T39x+Le8HGQdrP0Iobbyj1pmnkUPovpNHrTq+p lngQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683597; x=1733288397; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=utZlEfz+5dQ67HxxRHCS5IF8SSWsM/ZWS2gS45Zg7cI=; b=oqG0nVIcDXr8N2kORoJw9jodosuVNwPVog0cC9QfuN2/3xHbZUkQSRvbtTWRj2zDq9 oP7lOzC1DidNbFaR7GeAIMvxc8O4VUbefntY9/xRhg9J2viyvYP0RP1WPC625Nf/7Hx+ +PUMy9lCjIEOaSnpWkcHtc8vYI4K3hPdCPvODkj8jI3pOO/i7A4awcIkDg9kbrGC2g33 uK975Z0qGAY80Lv884VdH8V7W9mIbrA0yKeplT5JLnOu7D7jbvbmNxKfX9m9wOfk+lId V4WZGwVP8ge6S6Kqay4Zy96GgenFQsMRmFurhQTE+t0JQj6Av5PH8FmLEnIphVlnK56e 6bKw== X-Gm-Message-State: AOJu0YyP/inqKi6blsc3SA6uexDQJ6uqO1mHnFJfxlJkCBAlFHIrk9vW qm/sRofvwdX4iiNOGlFS7eCSjoUT/NSvyqYz/0Er3AvzToJb+8SL+pUj8SFV4RNJmQqXT8wWzY2 J X-Gm-Gg: ASbGncse8poTT+fbvWiB3i72WO/mQBsh/2ZVyjheelGtJMqwEkKJceDuJZ/NOqKxQdZ X5mLRvZEH8kAk/uc6lyFMoi2SFWRnXkeQpXCcEiLZDauyaz4AIHvwBxuwW8UIuJ4IdC3ZpPrCBc qmIbweaoymlk0E74xom5eeIEqN/2YEFi4sHY9eG3Nxg7vyDGewMrt7lgrM0VVb8y9l2UfFJ4q11 s+QSDbvAhxicCsO9/NGyFx7k9p1aQVdynISlkaNUDLF4R9mE1RT4i9NItPtA5L54B7Xh9mS333Z k7HO2iojkCwF/w== X-Google-Smtp-Source: AGHT+IHR+N4uic1Lb69P9ZtgkuukxcvYP7eh1kQbKbYK5vIWYH12vB9CzvJS8LRp/0CN+6SYZKyjSA== X-Received: by 2002:a05:6a20:3944:b0:1d8:a13d:d6b2 with SMTP id adf61e73a8af0-1e0e0ac2cdbmr3093537637.10.1732683597233; Tue, 26 Nov 2024 20:59:57 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724de531b5bsm9272346b3a.99.2024.11.26.20.59.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:56 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZUv-1Wa7 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQep-257J for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 17/40] xfs/442: rescale load so it's not exponential Date: Wed, 27 Nov 2024 15:51:47 +1100 Message-ID: <20241127045403.3665299-18-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner .... xfs/442 491 .... xfs/442 takes a long time to run because it is scaling the load by the number of processes it is going to run on twice. It scales the number of operations by the number of processes it is going to run, meaning that doubling the number of processes quadruples the runtime. Reduce it to scale linearly by fixing the number of ops it runs per process. Signed-off-by: Dave Chinner --- tests/xfs/442 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/442 b/tests/xfs/442 index 58e56b5d2..d539fa5e0 100755 --- a/tests/xfs/442 +++ b/tests/xfs/442 @@ -63,7 +63,7 @@ _scratch_mkfs_sized $((1600 * 1048576)) > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 nr_cpus=$((LOAD_FACTOR * 4)) -nr_ops=$((25000 * nr_cpus * TIME_FACTOR)) +nr_ops=$((25000 * TIME_FACTOR)) _run_fsstress -w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus echo "Check quota before remount" From patchwork Wed Nov 27 04:51:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886576 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 220524689 for ; Wed, 27 Nov 2024 05:00:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683602; cv=none; b=HmKglOZ4hBevnxQk+L4QiLSzBUt3Y+ovvCH3bDrwBMCeCv0CLZyP9sZaUaiie7iY6q55L8zfihEnY0dSuwsqgF9n5FzlkJpIYBbFHdPBzWY8TEnEUGmzP+P1EKS15Mx+KngbfPm47EriZUIbCwv2FtZ8nOvb+Y72pQKy083UJGw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683602; c=relaxed/simple; bh=A0slEnRi3Nrium96xvU6OZMqxy1dB8zO0sa5Tvc6328=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XEgwrqjbZ6ViHBhjTzG+OEm8681tl0YOiRFtJCiD1m55a26DHMVnCMeEtfifNyvpfCXYKVQzkHPEIPRay0luW+eeE+dPv7RcfznQdx/JSo/5bG6aOQGygT5bZnA2Fz63NLv+J2L0/Ef9IkG8JLFarufgS7dL9BkYskcC93DL+ag= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=pwF6mfMS; arc=none smtp.client-ip=209.85.215.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="pwF6mfMS" Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-7fbbe0fb0b8so4818499a12.0 for ; Tue, 26 Nov 2024 21:00:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683600; x=1733288400; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Ho6Fd801zwPVdXsIjfXb0nCFNvhnvHgiMu+2yU1aQQQ=; b=pwF6mfMS/fbwLQjBZhxDQ8ZLly36xMMhORGvwiVf+QCcrLeWRCX0T6fX6auOId4mIz 1zvPkldBzufUg84MFC2OAG8Co+9jpjLiN5BSE4d4mw3786ORNKsx3idlGQbYOHmXwJgR pCQZ2hBBE5HV6+hISq8kyTiXEzP+O3lXb08pwO1N8qXiyKuyPLvE1cE1HP5v+tmXeuGi 2kVHkNwOYOPyYH3u2f9GiAOC69iFZkG1lqOijvV9ceMA6MHZ1T2/d6584Xi3jvNsBiuI Ucyk1iJru44LXgl6AV9OJgFmcn2HQMkPfmasK/KJdsXmjaWZFNB9M7AnywhK+S+IU7Uz fi1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683600; x=1733288400; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ho6Fd801zwPVdXsIjfXb0nCFNvhnvHgiMu+2yU1aQQQ=; b=SAunMIOiwR+eULBDDL+kSwfw2QHTwryyjSKcnw2V50zggrijOfa6+zG8yYiL9El+Vl hmuUTa8homkEGsA5S8zbR8w5S1yA3JIZ/ytBDqWzYUAxj27a2sKWHiA1vmlnOr2tioez 7xm8lwYWlqoEuXeU5zwh7wmTFXPs0XXwsZ9zYNzCzPc9VVdEsZsEYpiuAixAJMS/je6R tlDtE9RB80yhTOgCcZMxQ83kMa2DzSlVMcvDU3NamaiM3+QzbPCVyPSoJCU+iCEYTsIg 97RuKG5aPIAK1lVJc+11/wk6tCdnF8mh2x6oj3BRZSDwpdkeuu3XcN9CbPZpRo0ODvcn 3dHA== X-Gm-Message-State: AOJu0YzHdd7XPIy6nNT7/cwe4cIJP777IbGZocyqIvB2XusdOY/PMcT3 Y75CTvBndo8W66DMvSDET5TVHMepq72bLOZJUh2q2gwXoidqEtgogAYuwjizfyc1rQB8JeBvETE j X-Gm-Gg: ASbGnctyHMDuI7NiwBvE+jERjELNq7CasbJJgnEVmeCaq6ng2IDdvgYCzQ8x053uN+a 1rJSIbj953+UHH9BfYQiLFgauOD/auWDSV17BukJqBgxE69qeBdt2MMiJ45UHCU341/sNDW8+mY 6DE0XlX5rvpBfPW7veD/7/XPmCkVuBvVHg2xQF26UWTT9IcHFx3fIiAJQQXrC2iPZRI7j4WzY19 kf02Ic5jbkDgBUSk70C3pUDahrEhWyMZP4H8hfK+c6cxmgEzSZE6qez8AJBs1pjMz8y3gbyOBUv VVXiMhDYuq1czA== X-Google-Smtp-Source: AGHT+IFubvdnPshRVsX9HA24Xqjds4I27sHUvdeOKPMCNJBg2on2DhTq6GnKvwzzU9Waq9eW2D4WhQ== X-Received: by 2002:a05:6a21:3289:b0:1e0:ceb4:b7df with SMTP id adf61e73a8af0-1e0e0b10582mr3217361637.25.1732683600477; Tue, 26 Nov 2024 21:00:00 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dbfee73sm93597595ad.150.2024.11.26.20.59.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 21:00:00 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZUz-1iu8 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQeu-2EOH for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 18/40] xfs/176: fix broken setup code Date: Wed, 27 Nov 2024 15:51:48 +1100 Message-ID: <20241127045403.3665299-19-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner The test does not pass the mkfs output through the mkfs filter, so the inode size is not set up correctly. Hence it calculates the CHUNK_SIZE as 0, and it ends up getting stuck in an endless loop throwing ENOSPC errors because the offset never changes. While there, use 'echo -n' rather than 'touch' to create zero length files much faster. Signed-off-by: Dave Chinner --- tests/xfs/176 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/xfs/176 b/tests/xfs/176 index e3fa87c43..8e5951ec1 100755 --- a/tests/xfs/176 +++ b/tests/xfs/176 @@ -21,7 +21,7 @@ _require_scratch_xfs_shrink _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" -_scratch_mkfs "-d size=50m -m crc=1 -i sparse" | +_scratch_mkfs "-d size=50m -m crc=1 -i sparse" | \ _filter_mkfs > /dev/null 2> $tmp.mkfs . $tmp.mkfs # for isize cat $tmp.mkfs >> $seqres.full @@ -69,7 +69,7 @@ _alloc_inodes() i=0 while [ true ]; do - touch $dir/$i 2>> $seqres.full || break + echo -n > $dir/$i >> $seqres.full 2>&1 || break i=$((i + 1)) done } From patchwork Wed Nov 27 04:51:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886565 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 329024689 for ; Wed, 27 Nov 2024 04:59:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683563; cv=none; b=mPydigYKFH0gke8m5V3m33BijH2Z7FqtL8VUFH7zhSdePSPTVnFjucaOUugxdoS+AesHvuZy89FtPbGzkkh4qSykJfooDPYRS1+PPIwunROge7xHLmgzwHfUDEXPv4HPJ4wNXjdR8Nz7wPQiygP7Rb2JxvxLJLLTg4O+SHIrqss= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683563; c=relaxed/simple; bh=8F3ahj52RLuFFYcpclQOTqaI1agSd8O2tSilTsS3lQ8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TlYpgbDp/IPgOpp92wT5uegbn+Em2s+RL+2QLO6oUTmDIA3i7zOp1jwlc7sleIFMNhxi3YKfwnZUBe1Y/W8AKZwPDzf9qXzV5dVmJN5NU3jbWSMk5ADBzddfNENvw1rXV59F9ejzvWs/vinVGHFHDYIEJVStIVbB+bYhFjKFh4A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=i24n/JAF; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="i24n/JAF" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-21207f0d949so60715145ad.2 for ; Tue, 26 Nov 2024 20:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683561; x=1733288361; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=heLgL7p4r4D/esMWLUmlF6hx36ceCs2TRfNR0C6IBB8=; b=i24n/JAF6Ak0shmtdGlJlzRhcrlJ5yTaAeNm47BVjJAo6v8wFDpWByY1AvElTIxJ+K iC7lRHXLI1yqKVMOmWWLUIEtLAtqOwppVG/yOBCSJoU9s3Tdyv95LxHZ1ApYyAbLo2vi BcQzBHSWgkd7UojQye4XuO6dGVMa/UVGnL5OJ+hoGiSvn2d8O6fYaR5eKbBX5HK1G5Mc RVttl5jmqqqn8xxz7mTBvI5yibbE9WCdpMVGMg9qSM9JW9a6ZHouFpmBmJCxtXo9egIL h55FOAfoTtMxiYyLu7yj9rmckbfu7yHd7yUBqIBZp3BLApTYE3G3L4/mKd/38kNcKF1o 5DmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683561; x=1733288361; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=heLgL7p4r4D/esMWLUmlF6hx36ceCs2TRfNR0C6IBB8=; b=X1mRXCD4tYlgP2+C8cCcpYNWmWCblv7oGDwBBEixZJ3MTgs88oU0w8GXOeohTuWyoY sfz/MbeEExY88huFWjlH+DiHFSKRRgf+B1d3BIO8o1z3aJmyGqgNjU2SKFFx50/h4l/g FIbToAHwunaxD7LZAOef45zA3c5pg/WUNRqVnfFKPyJf7IfVdPeXiTimC5swkBoTWSLL pk62Sv/ovN+GvrksThXdMmlhh3N8FTGuUofeeMHzo//95Rt5pHaMCzO11ylf1/pyG2ux qYC7A95B6ERxUkMgrYX2TQMw//jaFokBdy559hD9dpvSkLGgHEFp5Mj17/GAwySE4lwO N2gA== X-Gm-Message-State: AOJu0YyTGMvUStR5LIG0gdqu+v5+kGRxiu/4HN1OYle6pjWupg+tjB8t mlSgx3T9B6x8yCFIDdKLuA6SjJo4spadxFGwhaN/aCaWvTT8HlajkOQXAPgQp7Pfvkn/V/mJX8X t X-Gm-Gg: ASbGnctiwaGk+2UORYMzystrHFe3sp9ZMX/i348Ef0Z4geuWge47KtviQcHwJgRgfuf uilPLMVFPlfzP78GokhuavdY8UDd+DmHJDzZIxGq/U/rxcqQMApbokseXfPM2DTRinzWvUHdkNN V44xeO0OxLWB7GK3RXvyrsWCgaACFuMPE0gyOciS7biH+T7ik8KI6Qke9ZwerelY5MZyr2w1CXi 48/ejPpXsn3CPeDjO9frtaiBFO3BwlwTnG0kkHDVY1SlAFdfJnuuULiNVsHk37H8OBZj5TyL5k0 o0U2UkyAJojcmA== X-Google-Smtp-Source: AGHT+IEVOF96wJZ90spLA5OvJhf/aYzgbJhHfn5iQ+ARBIyFBqlNwKFxdwkD0HsYcq9ygBn2NzKTfg== X-Received: by 2002:a17:902:e810:b0:212:5d38:b45f with SMTP id d9443c01a7336-21501085456mr23879215ad.8.1732683561529; Tue, 26 Nov 2024 20:59:21 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dc208b6sm93590565ad.229.2024.11.26.20.59.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:21 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZV1-1nuE for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQez-2N7w for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 19/40] xfs/177: remove unused slab object count location checks Date: Wed, 27 Nov 2024 15:51:49 +1100 Message-ID: <20241127045403.3665299-20-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Stale code; we count XFS inodes through the sysfs stats code now so remove it. Signed-off-by: Dave Chinner --- tests/xfs/177 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/xfs/177 b/tests/xfs/177 index 22719ba1c..82b3ca264 100755 --- a/tests/xfs/177 +++ b/tests/xfs/177 @@ -58,13 +58,6 @@ dump_debug_info() { echo "round $1 baseline: $baseline_count high: $high_count fresh: $fresh_count post: $post_count end: $end_count" >> $seqres.full } -# Either of these need to be available to monitor slab usage -xfs_ino_objcount_file=/sys/kernel/slab/xfs_inode/objects -slabinfo_file=/proc/slabinfo -if [ ! -r "$xfs_ino_objcount_file" ] && [ ! -r "$slabinfo_file" ]; then - _notrun "Cannot find xfs_inode slab count?" -fi - # Background reclamation of disused xfs inodes is scheduled for ($xfssyncd / 6) # centiseconds after the first inode is tagged for reclamation. It's not great # to encode this implementation detail in a test like this, but there isn't From patchwork Wed Nov 27 04:51:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886564 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E2764689 for ; Wed, 27 Nov 2024 04:59:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683560; cv=none; b=FiaSdAj7QDi9bXRkl/wnURTXD4eq1WcPNIbqqNR08gnC/N+e5XEZ+PlKfWwx+OKHViW1grK2w7/sxZGChl1kK2/BJTKxJ7Dyjkalg6sQa1hWybSbs3Hs1PQ07L3K5xOwAmb6x/au02Kqtw+OWSDC4DQX1p7hNlgYCZgnYg46Bkw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683560; c=relaxed/simple; bh=/aioeyQvFoc6B1SqBzxOODsYSdbUgcHCGBITxzlht9M=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sBoT9/UhM5DTDXMEgZywXPxfSJYBqqIMPat3WMwJ0GPgJe1gZeRkFbrHWYCrdNSxSzCaQ/9AMlcrH+rG+oN6w2mlJz+l0BIH8xuISZvCt2RUCDZbQ0wDZoM1hXKXSEenn7nTz+GcGOzOpeeYLqcKR+1cX0K6ZPI4X8hhnAGZCAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=jvzr+G39; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="jvzr+G39" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2ed91d2a245so3458469a91.3 for ; Tue, 26 Nov 2024 20:59:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683558; x=1733288358; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0o756Sv1FWMDVCjaqmEybhTcLEwYqubtWxCFzLHBkqk=; b=jvzr+G399n6EM7hQOXDkyPrDIFG9DnzgiVM+z75fz7kK1xaEE986bD9BLH/LDvOiLX hDqAj+jqFPu4b5BwErv6A8YtvG1SXff7ciM06dFXheUvBVf8Z+CSLUAG3foozoVauQMj QhYxjXta+T7xrznxUP5sN8q8EFosaMb6qdrPSxLdtJJwQ4BhhSiYmHlMF5PY0dav9Ivt IzO+2Uk2jemZfzhIuvsPISrlqsGvslAfTHrU3SZfcrdBDgLwefkEV4ZEx8jG7b6kBp4I H3EMz0u9aYSbeSEDU6khHn3hp96NGSM6f8CJjienfhv16JXV7EvGzMoswlXp0L2QxITY hR7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683558; x=1733288358; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0o756Sv1FWMDVCjaqmEybhTcLEwYqubtWxCFzLHBkqk=; b=lrJ9bqzEn+3iSP54Afx6gtv0eDQeU2hbJDnaI2jTUFCd1BA6mOMLJsQZB0qSf5B6t9 hjZjlwtAhwPBCsPxivoKI5nznmI9QTAZPDSW6Mazuxlz60RauOO2P783RMtULCGjDAiK I+JmUCLOY3OOm0pCwfC2OZ+KIBSOqOFixnqANBxdBInCs0D5oc5Y25p3LB3J2re8SKxT E2rcxHYPSF8jUcv2iK5A6IK8dx43J1kacsAKdG+A7l6KFide7Z2wh3MKJfw5jqSCrABn P9zoCL+JX44ucVQl97IU7XasQWA8jvv6tRq2dlI0sIOsWCWFog2X/zv5IDnv792H43NR z2vg== X-Gm-Message-State: AOJu0YzJoQJRaffR7sZPGJFZQkmGvI4fm6eAoi4mn77UbYdnA+5HVZgP Q12bZcgEvA4EEW6Bjj8sHXYp1dB58I47pJ2UmlUJ6U8i2m7UWNmbMnj9dUL2MpxR6dYAMUfzLHy u X-Gm-Gg: ASbGncuqKh9ZsFMIgC2yFNr1MQQI0LcZzzNs6wyK9uHwwMM8Y9T0XcTqGsYj8lMkdrU +zupiRyRrGgnlqgVvdVrZOmwGL9f8X8SXH7eV81Ywy8dYkWBbPabcwCSVnIBU471CBdQFkaenAl 1uBDWgN9rmAx+P0NC8wkuLPBAY6hgmYEDBLqtg6KJPwIl9EQQ8MwvQ3uj3Itzg+fDSeAO0fqrmv O8XwDEDdaAiQ2n6Nx+r1TNAkBJPwNW30+0ZVmS3nqudQmrmf65zJO9Nh+r5y27Quf0cl2JKc5X/ 1O1pRuKfs39Sgg== X-Google-Smtp-Source: AGHT+IFPngOa+Iv92XOEVCsfcovFTjhfi2SAvZ7P0IA1zWxb2+UrpyixAx98xvf4EF1/RG5xffDhnA== X-Received: by 2002:a17:90b:1a8e:b0:2ea:4290:7274 with SMTP id 98e67ed59e1d1-2ee08e9fe02mr2457168a91.10.1732683558431; Tue, 26 Nov 2024 20:59:18 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee0fa480e3sm502038a91.17.2024.11.26.20.59.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:17 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZV6-1uhf for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQf3-2VLA for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 20/40] fstests: remove uses of killall where possible Date: Wed, 27 Nov 2024 15:51:50 +1100 Message-ID: <20241127045403.3665299-21-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner there are many unnecessary uses of killall and stale checks for it's existence. Parallel check execution means killall is considered harmful, so get rid of these unneccesary uses. Signed-off-by: Dave Chinner --- common/config | 1 - common/fuzzy | 6 +++--- doc/requirement-checking.txt | 6 +++--- tests/btrfs/192 | 1 - tests/btrfs/212 | 2 -- tests/generic/270 | 1 - tests/generic/310 | 22 +++++++++++++++++----- tests/generic/751 | 1 - tests/overlay/058 | 12 ++++++++---- tests/xfs/011 | 1 - tests/xfs/013 | 1 - tests/xfs/051 | 1 - tests/xfs/057 | 1 - tests/xfs/070 | 9 +++++---- tests/xfs/079 | 1 - tests/xfs/141 | 1 - tests/xfs/167 | 3 --- tests/xfs/297 | 2 -- tests/xfs/442 | 1 - 19 files changed, 36 insertions(+), 37 deletions(-) diff --git a/common/config b/common/config index 41b8f29d1..6f531c43d 100644 --- a/common/config +++ b/common/config @@ -182,7 +182,6 @@ export CHACL_PROG="$(type -P chacl)" export ATTR_PROG="$(type -P attr)" export QUOTA_PROG="$(type -P quota)" export XFS_QUOTA_PROG="$(type -P xfs_quota)" -export KILLALL_PROG="$(type -P killall)" export INDENT_PROG="$(type -P indent)" export XFS_COPY_PROG="$(type -P xfs_copy)" export FSTRIM_PROG="$(type -P fstrim)" diff --git a/common/fuzzy b/common/fuzzy index 3a7f04aae..534e91ded 100644 --- a/common/fuzzy +++ b/common/fuzzy @@ -1188,14 +1188,14 @@ _scratch_xfs_stress_scrub_cleanup() { # a race condition that can hang fstests. # # If the xfs_io -c freeze process is asleep waiting for a write lock on - # s_umount or sb_write when the killall signal is delivered, it will + # s_umount or sb_write when the kill signal is delivered, it will # not check for pending signals until after it has frozen the fs. If # even one thread of the stress test processes (xfs_io, fsstress, etc.) - # is waiting for read locks on sb_write when the killall signals are + # is waiting for read locks on sb_write when the kill signals are # delivered, they will block in the kernel until someone thaws the fs, # and the `wait' below will wait forever. # - # Hence we issue the killall, wait for the freezer loop to exit, thaw + # Hence we issue the kill, wait for the freezer loop to exit, thaw # the filesystem, and wait for the rest of the children. if [ -n "$__SCRUB_STRESS_FREEZE_PID" ]; then echo "Waiting for fs freezer $__SCRUB_STRESS_FREEZE_PID to exit at $(date)" >> $seqres.full diff --git a/doc/requirement-checking.txt b/doc/requirement-checking.txt index 802bf2a3f..78990fe9e 100644 --- a/doc/requirement-checking.txt +++ b/doc/requirement-checking.txt @@ -40,11 +40,11 @@ _require_command "$NAME_PROG" name should then be used to refer to the command when executing it. For example: - _require_command "KILLALL_PROG" killall + _require_command "$XFS_DB_PROG" "xfs_db" - to locate the killall command and then: + to locate the xfs_db command and then: - $KILLALL_PROG -q $FSSTRESS_PROG + $XFS_DB_PROG -c "sb 0" -c "print" $SCRATCH_DEV to make use of it. diff --git a/tests/btrfs/192 b/tests/btrfs/192 index cc8e1e003..0a8ab2c1b 100755 --- a/tests/btrfs/192 +++ b/tests/btrfs/192 @@ -27,7 +27,6 @@ _cleanup() . ./common/dmlogwrites -_require_command "$KILLALL_PROG" killall _require_command "$BLKDISCARD_PROG" blkdiscard _require_btrfs_fs_feature "no_holes" _require_btrfs_mkfs_feature "no-holes" diff --git a/tests/btrfs/212 b/tests/btrfs/212 index 745b9598a..80c702720 100755 --- a/tests/btrfs/212 +++ b/tests/btrfs/212 @@ -25,8 +25,6 @@ _cleanup() . ./common/filter _require_scratch -_require_command "$KILLALL_PROG" killall - _scratch_mkfs >> $seqres.full _scratch_mount diff --git a/tests/generic/270 b/tests/generic/270 index aff379ac5..342ac8b5d 100755 --- a/tests/generic/270 +++ b/tests/generic/270 @@ -56,7 +56,6 @@ _workout() _require_quota _require_user _require_scratch -_require_command "$KILLALL_PROG" killall _require_command "$SETCAP_PROG" setcap _require_attrs security diff --git a/tests/generic/310 b/tests/generic/310 index 15e87aece..1ae9e0233 100755 --- a/tests/generic/310 +++ b/tests/generic/310 @@ -29,14 +29,19 @@ _begin_fstest auto # Override the default cleanup function. _cleanup() { + if [ -n "$readdir_pid" ]; then + pkill --parent "$readdir_pid" t_readdir > /dev/null 2>&1 + kill -9 $readdir_pid > /dev/null 2>&1 + wait + fi rm -rf $TEST_DIR/tmp + rm -f $tmp.* } # Import common functions. . ./common/filter _require_test -_require_command "$KILLALL_PROG" killall dmesg -c > /dev/null @@ -80,9 +85,12 @@ done _test_read() { - $here/src/t_readdir_1 $SEQ_DIR & + $here/src/t_readdir_1 $SEQ_DIR > /dev/null 2>&1 & + readdir_pid=$! sleep $RUN_TIME - $KILLALL_PROG t_readdir_1 + kill $readdir_pid + unset readdir_pid + wait check_kernel_bug if [ $? -ne 0 ]; then _fatal "kernel bug detected, check dmesg for more infomation." @@ -91,9 +99,13 @@ _test_read() _test_lseek() { - $here/src/t_readdir_2 $SEQ_DIR & + $here/src/t_readdir_2 $SEQ_DIR > /dev/null 2>&1 & + readdir_pid=$! sleep $RUN_TIME - $KILLALL_PROG t_readdir_2 + kill $readdir_pid + unset readdir_pid + wait + check_kernel_bug if [ $? -ne 0 ]; then _fatal "kernel bug detected, check dmesg for more infomation." diff --git a/tests/generic/751 b/tests/generic/751 index eac2d230a..892e59edf 100755 --- a/tests/generic/751 +++ b/tests/generic/751 @@ -80,7 +80,6 @@ fio_err=$tmp.fio.err _require_test _require_scratch _require_split_huge_pages_knob -_require_command "$KILLALL_PROG" "killall" _fixed_by_git_commit kernel 2a0774c2886d \ "XArray: set the marks correctly when splitting an entry" diff --git a/tests/overlay/058 b/tests/overlay/058 index b70e06638..b19a47e36 100755 --- a/tests/overlay/058 +++ b/tests/overlay/058 @@ -21,8 +21,10 @@ _begin_fstest auto quick exportfs # Override the default cleanup function. _cleanup() { - $KILLALL_PROG -9 open_by_handle >/dev/null 2>&1 - wait + if [ -n "$pids" ]; then + kill -9 $pids >/dev/null 2>&1 + wait + fi cd / rm -f $tmp.* } @@ -36,7 +38,6 @@ _require_test_program "open_by_handle" # We need to require all features together, because nfs_export cannot # be enabled when index is disabled _require_scratch_overlay_features index nfs_export -_require_command "$KILLALL_PROG" killall # All overlay dirs are on scratch partition lower=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER @@ -89,9 +90,11 @@ test_file_handles $SCRATCH_MNT -rnp -i $tmp.lower_file_handles # overlay dentries in cache _scratch_cycle_mount "index=on,nfs_export=on" test_file_handles $SCRATCH_MNT -rnps -i $tmp.upper_file_handles & +pids=$! # Give the above 1 second to get to sleep loop sleep 1 test_file_handles $SCRATCH_MNT -rnps -i $tmp.lower_file_handles & +pids="$pids $!" # Give the above 1 second to get to sleep loop sleep 1 @@ -105,8 +108,9 @@ test_file_handles $SCRATCH_MNT -rnp -i $tmp.upper_file_handles test_file_handles $SCRATCH_MNT -rnp -i $tmp.lower_file_handles # SIGPIPE avoids Terminated/Killed message from bash -$KILLALL_PROG -q -13 open_by_handle +kill -13 $pids > /dev/null 2>&1 wait +unset pids status=0 exit diff --git a/tests/xfs/011 b/tests/xfs/011 index ed69879c5..1192e75dd 100755 --- a/tests/xfs/011 +++ b/tests/xfs/011 @@ -14,7 +14,6 @@ _begin_fstest auto freeze log metadata quick _require_scratch _require_freeze _require_xfs_sysfs $(_short_dev $TEST_DEV)/log -_require_command "$KILLALL_PROG" killall . ./common/filter diff --git a/tests/xfs/013 b/tests/xfs/013 index c68c6ad85..fd3d8c64c 100755 --- a/tests/xfs/013 +++ b/tests/xfs/013 @@ -74,7 +74,6 @@ _cleaner() _require_scratch _require_xfs_mkfs_finobt _require_xfs_finobt -_require_command "$KILLALL_PROG" killall _scratch_mkfs_xfs "-m crc=1,finobt=1 -d agcount=2" | \ _filter_mkfs 2>> $seqres.full diff --git a/tests/xfs/051 b/tests/xfs/051 index bb9c36da8..fe3d75cab 100755 --- a/tests/xfs/051 +++ b/tests/xfs/051 @@ -19,7 +19,6 @@ _begin_fstest shutdown auto log metadata _require_scratch _require_dm_target flakey _require_xfs_sysfs debug/log_recovery_delay -_require_command "$KILLALL_PROG" killall echo "Silence is golden." diff --git a/tests/xfs/057 b/tests/xfs/057 index 62eb8b93c..da583e621 100755 --- a/tests/xfs/057 +++ b/tests/xfs/057 @@ -42,7 +42,6 @@ _cleanup() _require_xfs_io_error_injection log_item_pin _require_xfs_io_error_injection log_bad_crc _require_scratch -_require_command "$KILLALL_PROG" killall echo "Silence is golden." diff --git a/tests/xfs/070 b/tests/xfs/070 index d2bd7e2c4..143f56888 100755 --- a/tests/xfs/070 +++ b/tests/xfs/070 @@ -24,10 +24,10 @@ _begin_fstest auto quick repair # Override the default cleanup function. _cleanup() { + [ -n "$repair_pid" ] && kill -9 $repair_pid > /dev/null 2>&1 + wait > /dev/null 2>&1 cd / rm -f $tmp.* - $KILLALL_PROG -9 $XFS_REPAIR_PROG > /dev/null 2>&1 - wait > /dev/null 2>&1 } # Start and monitor an xfs_repair of the scratch device. This test can induce a @@ -45,7 +45,8 @@ _xfs_repair_noscan() repair_pid=$! # monitor progress for as long as it is running - while [ `pgrep xfs_repair` ]; do + running=`pgrep xfs_repair` + while [ -n "$running" ]; do grep "couldn't verify primary superblock" $tmp.repair \ > /dev/null 2>&1 if [ $? == 0 ]; then @@ -58,6 +59,7 @@ _xfs_repair_noscan() fi sleep 1 + running=`pgrep xfs_repair` done wait @@ -72,7 +74,6 @@ _xfs_repair_noscan() # Modify as appropriate. _require_scratch_nocheck -_require_command "$KILLALL_PROG" killall _scratch_mkfs | _filter_mkfs > /dev/null 2> $tmp.mkfs diff --git a/tests/xfs/079 b/tests/xfs/079 index 794d2db49..4a1999bb8 100755 --- a/tests/xfs/079 +++ b/tests/xfs/079 @@ -23,7 +23,6 @@ _begin_fstest shutdown auto log quick # Modify as appropriate. _require_scratch _require_v2log -_require_command "$KILLALL_PROG" killall echo "Silence is golden." diff --git a/tests/xfs/141 b/tests/xfs/141 index b630ba10d..6aa844825 100755 --- a/tests/xfs/141 +++ b/tests/xfs/141 @@ -20,7 +20,6 @@ _begin_fstest auto log metadata # Modify as appropriate. _require_xfs_io_error_injection "log_bad_crc" _require_scratch -_require_command "$KILLALL_PROG" killall echo "Silence is golden." diff --git a/tests/xfs/167 b/tests/xfs/167 index 5ef2aa2ea..2a6e6b8d0 100755 --- a/tests/xfs/167 +++ b/tests/xfs/167 @@ -21,10 +21,7 @@ workout() # Import common functions. . ./common/filter - -_require_command "$KILLALL_PROG" killall _require_xfs_io_command "falloc" - _require_scratch _scratch_mkfs_xfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/xfs/297 b/tests/xfs/297 index 66c5d0cc7..f9cd2ff12 100755 --- a/tests/xfs/297 +++ b/tests/xfs/297 @@ -24,10 +24,8 @@ _cleanup() # Import common functions. . ./common/filter - _require_scratch _require_freeze -_require_command "$KILLALL_PROG" killall logblks=$(_scratch_find_xfs_min_logblocks -d agcount=16,su=256k,sw=12 -l su=256k) _scratch_mkfs_xfs -d agcount=16,su=256k,sw=12 -l su=256k,size=${logblks}b >/dev/null 2>&1 diff --git a/tests/xfs/442 b/tests/xfs/442 index d539fa5e0..08f0aac40 100755 --- a/tests/xfs/442 +++ b/tests/xfs/442 @@ -21,7 +21,6 @@ _begin_fstest auto stress clone quota _require_scratch_reflink _require_quota -_require_command "$KILLALL_PROG" "killall" report_quota_blocks() { $XFS_QUOTA_PROG -x -c "report $1" $SCRATCH_MNT | \ From patchwork Wed Nov 27 04:51:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886572 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9127D4689 for ; Wed, 27 Nov 2024 04:59:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683588; cv=none; b=k/yxzN3/sjIzB9BwLA+jZk1jJEtm6vjqS/RctANW0KjizUxUlHWIwdeD8yhMkou1P34Xflw3bmbHpD8n3pNJKsEpE+ZyOBltrnCe+BB+ftt0qzO2qxyyFB8ZityMf9pS2wlZMpm5MSx9V8lGqV3CK7SiovjFQRpL8THLtmtnOd8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683588; c=relaxed/simple; bh=6lk5SvdJgCvc3NF57facjOsN22xR1dJpxk4y/YrBOxk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bJhP51MRGINKwsmoGCt3KugnhjZcwXWAfeYQxghu8/Yuzmae7VE3FhnJ0h3B/xOjQCUptuPfB/TWXcTzN3e+E8VORV7UMtOrp628Gt3YJ2Xic4iE9ambNvL/zYQoXP1XUy0/x0LIv1NN9P4vrL6ZI0GyfKfx76e1dNcV+8S5XhQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=qRRERs8w; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="qRRERs8w" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-724f41d520cso2532108b3a.1 for ; Tue, 26 Nov 2024 20:59:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683586; x=1733288386; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=fCIfwS9+Qu4/GAAoXb9FEN4Ou9bsUTltYBHizoDa+q0=; b=qRRERs8wChjyOyUB5JZKZcAq7LlLjIXKAjitwBf9M6LWeXghGDNXAnu4xFUIDfTQnh mQc8xwJ7ZAWB5YOCtbeUz4iz/JGxpKjWj7pyLFaIoR1ZSIOfVea/lKWB1qq9LqqMSvDs WkYt3t73Om2BsdwM1qTYsOqQOXQf2y/3LwipeqRAFPrcohI6VqjfsR2f8jq9plKiFwIq cC1RjLmPdYlGrCzFK1c/vVqmDtAUVC8ogT3G9y28RCtHEypm07VrW1R3uPUBclLhlNuR KB1n7emiBTW+j3yLAXWayOr2bBHFBKj1evCZ6A1BXrdX9FUXbZhPcmtsFf8e8Epo6J24 4WbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683586; x=1733288386; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fCIfwS9+Qu4/GAAoXb9FEN4Ou9bsUTltYBHizoDa+q0=; b=QQiTZ++rmirBZ8n28jC6jgYI0RXxRiboWZum4rvwBWpIg9vcJNA7mf6qz9prsbWjf5 UxtBhxIe/C6BUbqKsV8o+6PLSr+cFSsgB63fvjxpm68amy7nKy40aMrKIw3azCHgOlV2 vz5a0y9vrCeNrW8G1bXQZOqlcDRXa4+6GjiClbkgkRkktQl1tztj/EwEvsq2egunROMu QYfH0gbzpmPQE5394LQaU/duz4/DEQMUxm5ylux2ZiSQcXozv6Pv1Xw7OdPF1061dZ+A cvedj+SCxsI9pACWqVvyoMWTfz3KrrnNWLpgtCCh9rhfx/JikHuG09SZo0VEYfzLAxDO 2ylA== X-Gm-Message-State: AOJu0YxHY2R06oVqcxcFaCPawGhq8FHTr/sx2AwH1AYOQHlYc5SraOl/ 84aVXVAzfSNNc1Fj0sD7n1bMHgNlipNemocFIWoS/mm86YC0w0YxZQ/4ME3sHxRiJ2JBmRcTxqx S X-Gm-Gg: ASbGnct4s+QeqUKa3w7PVsieWtWTLPJTORNmi+M1EIgHyz8XpRjTtVgY+cyATyDy4O5 2ab5UaK8NGQ6XmryB02q3YFJTCv2GuleC6mXGBBW5hmu95zm8x5CG9k/s/FP0yuGmh9l4V8mo6M HAiO04XlLCYXZ/USEnazB9ZY0LlRKQZxsYXWmj9Alne/2SpbvLrX+kuHuDE1dnwB+TIU+CvYOul BOoPie/SGgU99xq5DX+IjcVzX8CWY/9t+63nHoG4LmR7EAYMNFU0YEUjIRWIZn2D7X22v6ZRU3c imLlx5v+fp0RpA== X-Google-Smtp-Source: AGHT+IHZvCYw6iMt327qi8ZlZpAYTHWFGkeoUYiRUK+eb9WYpClqu3oJyOPI0e42WFqw2kHaj5Tnpw== X-Received: by 2002:a05:6a00:3c8c:b0:71e:5d1d:1aa7 with SMTP id d2e1a72fcca58-7253011eef9mr2525036b3a.17.1732683585767; Tue, 26 Nov 2024 20:59:45 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724ead1e79asm8303978b3a.41.2024.11.26.20.59.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:45 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVC-2851 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQf8-2czh for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 21/40] generic/127: reduce runtime Date: Wed, 27 Nov 2024 15:51:51 +1100 Message-ID: <20241127045403.3665299-22-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner ... generic/127 684 ... This takes a long time to run because it runs 6 individual invocations of fsx sequentially. Make them run concurrently as they can operate on separate files. ... generic/127 168 ... Signed-off-by: Dave Chinner --- tests/generic/127 | 67 ++++++++++++++++++++++++++----------------- tests/generic/127.out | 6 ---- 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/tests/generic/127 b/tests/generic/127 index c8984f273..985c99cfb 100755 --- a/tests/generic/127 +++ b/tests/generic/127 @@ -16,7 +16,10 @@ _begin_fstest rw auto # Override the default cleanup function. _cleanup() { - rm -f $tmp.output + [ -n "$fsx_pids" ] && kill $fsx_pids 2> /dev/null + wait + cd / + rm -f $tmp.* } # Import common functions. @@ -27,7 +30,6 @@ FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000" _fsx_lite_nommap() { - echo "=== FSX Light Mode, No Memory Mapping ===" dd if=/dev/zero of=$TEST_DIR/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1 if ! ltp/fsx $FSX_ARGS -L -R -W $FSX_AVOID $TEST_DIR/fsx_lite_nommap > $tmp.output 2>&1 then @@ -41,7 +43,6 @@ _fsx_lite_nommap() _fsx_lite_mmap() { - echo "=== FSX Light Mode, Memory Mapping ===" dd if=/dev/zero of=$TEST_DIR/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1 if ! ltp/fsx $FSX_ARGS -L $FSX_AVOID $TEST_DIR/fsx_lite_mmap > $tmp.output 2>&1 then @@ -55,42 +56,56 @@ _fsx_lite_mmap() _fsx_std_nommap() { - echo "=== FSX Standard Mode, No Memory Mapping ===" - if ! ltp/fsx $FSX_ARGS -R -W $FSX_AVOID $TEST_DIR/fsx_std_nommap > $tmp.output 2>&1 - then - echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap" - cat $tmp.output - return 1 - fi - cat $tmp.output - return 0 + local fname="$TEST_DIR/$1" + + if ! ltp/fsx $FSX_ARGS -R -W $FSX_AVOID $fname > $tmp.output 2>&1 + then + echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap" + cat $tmp.output + return 1 + fi + cat $tmp.output + return 0 } _fsx_std_mmap() { - echo "=== FSX Standard Mode, Memory Mapping ===" - if ! ltp/fsx $FSX_ARGS $FSX_AVOID $TEST_DIR/fsx_std_mmap > $tmp.output 2>&1 - then - echo "ltp/fsx $FSX_ARGS fsx_std_mmap" + local fname="$TEST_DIR/$1" + + if ! ltp/fsx $FSX_ARGS $FSX_AVOID $fname > $tmp.output 2>&1 + then + echo "ltp/fsx $FSX_ARGS fsx_std_mmap" + cat $tmp.output + return 1 + fi cat $tmp.output - return 1 - fi - cat $tmp.output - return 0 + return 0 } _require_test -_fsx_lite_nommap || exit -_fsx_lite_mmap || exit +_fsx_lite_nommap & +fsx_pids=$! -_fsx_std_nommap || exit -_fsx_std_mmap || exit +_fsx_lite_mmap & +fsx_pids="$! $fsx_pids" + +_fsx_std_nommap fsx_std_nommap & +fsx_pids="$! $fsx_pids" + +_fsx_std_mmap fsx_std_mmap & +fsx_pids="$! $fsx_pids" #flush cache after write FSX_ARGS="-f $FSX_ARGS" -_fsx_std_nommap || exit -_fsx_std_mmap || exit +_fsx_std_nommap fsx_std_nommap_flush & +fsx_pids="$! $fsx_pids" + +_fsx_std_mmap fsx_std_mmap_flush & +fsx_pids="$! $fsx_pids" + +wait $fsx_pids +unset fsx_pids status=0 _cleanup diff --git a/tests/generic/127.out b/tests/generic/127.out index 9459dc897..99fb0fddc 100644 --- a/tests/generic/127.out +++ b/tests/generic/127.out @@ -1,13 +1,7 @@ QA output created by 127 -=== FSX Light Mode, No Memory Mapping === All 100000 operations completed A-OK! -=== FSX Light Mode, Memory Mapping === All 100000 operations completed A-OK! -=== FSX Standard Mode, No Memory Mapping === All 100000 operations completed A-OK! -=== FSX Standard Mode, Memory Mapping === All 100000 operations completed A-OK! -=== FSX Standard Mode, No Memory Mapping === All 100000 operations completed A-OK! -=== FSX Standard Mode, Memory Mapping === All 100000 operations completed A-OK! From patchwork Wed Nov 27 04:51:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886578 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD07CA41 for ; Wed, 27 Nov 2024 05:00:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683609; cv=none; b=rMmrbjLsk7oo+irghosnRE3xX2T0b31mS2zPX1VEfuOLMbVkVj+yZ7/5R3DZPWsUA/+sP/Zb8Jz0vULGtIVsLgyzaOm5FbWdHjvsjz+XesSgrizmwZNWPJDhZT3TemIjIyP0t+giWBPoBguvZHJoVVbUYGdNccbko35t7WU+m0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683609; c=relaxed/simple; bh=CI0DrwHIyVlhkcpoQcWRGebczictsjs6l8H2+NTpZu4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JwWfE9QPLGuTH+hnWXeqiq5Q1TXKDaLRwNVYUTJCgz24K7qmJPWzYHERVNZYRWUeDRFx7Ja4ImiXC3ApMEfJns7/HnRzfonhrsbnqhmG9eu4d5h9AR7U/jlJRqPCpYj6I2oPR2aH+VgfdPoxZQ8V1Ups5R+YeiHYmgyXO85ELas= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=QnOIhYHi; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="QnOIhYHi" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-724e113c821so4320830b3a.3 for ; Tue, 26 Nov 2024 21:00:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683607; x=1733288407; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=X4a3uqPBCa2xrPbVntVwBhqxfG2Z9aj8jm2PszE2m6k=; b=QnOIhYHiGwtoOBXKjElyCreuBgac30tFwHPDJreYnUoAfmvFERdYBCNFgPGlRYBxcx pPh2Jdh5VULYxrvfBdhw39xwT9CK2tl97M5Nm+Nf+tcBsp71o6w2F1dHIFKUWz4NKCQh l1zjZSvpT/Qsnupyh6W6A07OeCcoX+JRn27r9QLAzA2R4N70VGjnix3Mwi08BPQmFD32 rjO8rVmTFjkucugKG72ogRouhCL3MzIVrjj+T/pCVjf02qVBW4Owj8jvYICVdCBX5Ddc KKTJSWc1FgEoRofkEgA7aJzx5Y145SabH4ArR4PWKnUapq4IWcWE5/cv5M3B9fvj+5yI ShAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683607; x=1733288407; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X4a3uqPBCa2xrPbVntVwBhqxfG2Z9aj8jm2PszE2m6k=; b=v4ZJonich2Q2DVsgHm0xRMgDtyQHwQxuaYv4a5K39I5itnVZnP/sOFD6+oyntb6AI4 5fFrhdgPiyIBurD/YYKJp/2EP8ks25uR2vktl4LleEsLHkxrUmObgxiDQTUxF3GpWyla pjwpmax4sIiZRQxcYbJJ5o4BeoocvitDSqGmOJ5nFYfn0r5IANK+9OyGeyESm0FeInuB grfF9pVjlHSmMWNs3Vu5RZLRIdPOJz/oPMnv/u6x0zrZb1Xu+mKj/IcG6cl86HjBjwtd qIEFdmZ6lTI27FazdfJC2/uP5QY6eQnHXpIH920FmsKb6nXL+uubPKm2/TrjZBkQjih7 o6aw== X-Gm-Message-State: AOJu0YxHKzytgrUZmbASUEkcvlF6FQ45QJjraqQkyD1WBI6vcFp1XkCU 8b5UgGTW7MLCqH7yvNR0v56fSdG5dCubBu5+IM5YmvEQzj5GV98gLH9s8Qcc+FftfLEIIQFs0Ex S X-Gm-Gg: ASbGncsDbwxBMIkbIOMPvm/m+BIASgwnuEg2E2VrCiEAf9AY9Zcu8uPeVqp0l5b7c4U PfTxBkuu/CjOYZBA0Y2rudCNs8qRLlu0UDYupXru+t/ZYQGZgxi50zG+uqzbZ/oRTKQySpZjzE9 IbF/73tg/C1C+/kEA5mdPWzGnUNnUf/3bcd9/yu/HxpU895sfpOeP8w9w/0du3o/qyXHedp7o7A 3ovl589W4/WgCTH+sNzNL0JiwZ/PYk7XTZH2IFPQmx5SvGoi4iZ+Wuyv/1faknczq6d7sNigCEw NIq3Hf5JKCjIrg== X-Google-Smtp-Source: AGHT+IH61l7pqSnePrBRLSCSfkrTKAsodVXTTOhg7029WtMcADO0E2pcGJIDXakmn4BIr2zuKv4LAg== X-Received: by 2002:a05:6a00:230a:b0:724:f8d4:2b6e with SMTP id d2e1a72fcca58-72530012e07mr2462730b3a.4.1732683607099; Tue, 26 Nov 2024 21:00:07 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724e2393129sm9023370b3a.176.2024.11.26.21.00.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 21:00:06 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVD-2CWP for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQfE-2mnJ for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 22/40] quota: system project quota files need to be shared Date: Wed, 27 Nov 2024 15:51:52 +1100 Message-ID: <20241127045403.3665299-23-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Tests that treat them as exclusively owned end up tripping over other tests that do the same. Fix this by using append and filter techniques to update the files, then using different project quota ids for each test. Signed-off-by: Dave Chinner --- common/quota | 35 +++++++---------------------------- tests/generic/603 | 8 +++++--- tests/generic/691 | 6 ++++-- 3 files changed, 16 insertions(+), 33 deletions(-) diff --git a/common/quota b/common/quota index e87489192..8135b7c04 100644 --- a/common/quota +++ b/common/quota @@ -274,7 +274,7 @@ _choose_prid() _qmount() { - _scratch_unmount >/dev/null 2>&1 + _scratch_unmount _try_scratch_mount || _fail "qmount failed" # xfs doesn't need these setups and quotacheck even fails on xfs # redirect the output to $seqres.full for debug purpose and ignore results @@ -432,39 +432,18 @@ _create_project_quota() mkdir $prjdir chmod ugo+rwx $prjdir - if [ -f /etc/projects -a ! -f $tmp.projects.bk ];then - cat /etc/projects > $tmp.projects.bk - echo >/etc/projects - fi - if [ -f /etc/projid -a ! -f $tmp.projid.bk ];then - cat /etc/projid > $tmp.projid.bk - echo >/etc/projid - fi - - cat >>/etc/projects <>/etc/projid <> /etc/project + echo "$name:$id" >> /etc/projid $XFS_IO_PROG -r -c "chproj $id" -c "chattr +P" $prjdir } # If you've called _create_project_quota, then use this function in _cleanup _restore_project_quota() { - if [ -f $tmp.projects.bk ];then - cat $tmp.projects.bk > /etc/projects && \ - rm -f $tmp.projects.bk - else - rm -f /etc/projects - fi - if [ -f $tmp.projid.bk ];then - cat $tmp.projid.bk > /etc/projid && \ - rm -f $tmp.projid.bk - else - rm -f /etc/projid - fi + local id=$1 + + sed -i "/^$id:/d" /etc/project + sed -i "/:$id$/d" /etc/projid } # make sure this script returns success diff --git a/tests/generic/603 b/tests/generic/603 index 32dcaeb94..a84695831 100755 --- a/tests/generic/603 +++ b/tests/generic/603 @@ -10,10 +10,12 @@ . ./common/preamble _begin_fstest auto quick quota +projid=$seq + # Override the default cleanup function. _cleanup() { - _restore_project_quota + _restore_project_quota $projid cd / rm -f $tmp.* } @@ -122,8 +124,8 @@ _require_prjquota $SCRATCH_DEV BLOCK_SIZE=$(_get_file_block_size $SCRATCH_MNT) rm -rf $SCRATCH_MNT/t mkdir $SCRATCH_MNT/t -$XFS_IO_PROG -r -c "chproj 100" -c "chattr +P" $SCRATCH_MNT/t -_create_project_quota $SCRATCH_MNT/t 100 $qa_user +$XFS_IO_PROG -r -c "chproj $projid" -c "chattr +P" $SCRATCH_MNT/t +_create_project_quota $SCRATCH_MNT/t $projid $qa_user echo "### Set up different grace timers to each type of quota" UBGRACE=12 diff --git a/tests/generic/691 b/tests/generic/691 index 25ce92bc4..f33d6edf1 100755 --- a/tests/generic/691 +++ b/tests/generic/691 @@ -16,10 +16,12 @@ . ./common/preamble _begin_fstest auto quota +projid=$seq + # Override the default cleanup function. _cleanup() { - _restore_project_quota + _restore_project_quota $projid cd / rm -r -f $tmp.* } @@ -65,7 +67,7 @@ exercise() fi _qmount if [ "$type" = "P" ];then - _create_project_quota $SCRATCH_MNT/t 100 $qa_user + _create_project_quota $SCRATCH_MNT/t $projid $qa_user file=$SCRATCH_MNT/t/testfile fi From patchwork Wed Nov 27 04:51:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886563 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C8344689 for ; Wed, 27 Nov 2024 04:59:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683556; cv=none; b=q+sql6cb9RtJ230wZjR58UaHGNADzOAErZRHHJS68lCbGIku4NWOnBCA849oBg2Sue1q0m4AU4AuCCTDVOpntxv9ocJghMPV+ChykiBklBMWELRgk6hLLoy6Jm31WOFkV7HPgyBjjIO4dvP/5rSM0aSxg4VrWFVIU0RZsnHNesg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683556; c=relaxed/simple; bh=S7Kq+U13M1m8fIBANKREbPc7cch6T7ga0iGYO2E8274=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f+3NEalfQk6fpfwkt+TCyTbBAuh7z19uGcnZheYqVvWSQqWFGQOsKo1v/mphv1rLsq6XATwWMmqkT7Fb6OdGthpe10pzZ/AqKDReOWCF83rUVFOzq6c5S5rzHQ7hnuwhyigV4RxIyXl0x08Ak9patzBUgfUVyJIo40j8UCGCneg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=hmzvGR7g; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="hmzvGR7g" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-724e1b08fc7so4639082b3a.0 for ; Tue, 26 Nov 2024 20:59:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683554; x=1733288354; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=MQPQpsFy2U8zfr63hDof0WM2JO5DHeIUTDZDWHFKHHM=; b=hmzvGR7g2PX0WbqjPGE51YjNh15LGjJp00jw61U+WaBZa4rk2HFQVZMrTOKm1xE4+v ICwngHgNWUvqRQFYnKW1eGFIg0AkanpgEZfkT67OMyrFJKXMlEBGPmf+kYOwlglFasG/ 1Ptl5A7tsuRfHJLkTnetWFxTa7MiyrnMWrVoos8lRd6Ni/dTir7hfFg6IWCqcXpU6lep GwCU5DF0NmaRRGETzfv4R1eIcQqu9JHXyuJXqMcOXjbv/XTjAWfvU44WdSrnMggqupt4 Mu3C7dfP/PmddRkG3WTZLDp9oZ3fTDgN2Nt9morE3+Wx0rJUMq+8pG3z0QHNJMoy4jXT UuLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683554; x=1733288354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MQPQpsFy2U8zfr63hDof0WM2JO5DHeIUTDZDWHFKHHM=; b=PGBilrxtYdZ8H0dZOFAL/W6+OpS/bgiaoRJQiPSTYdjw0/02PNoRivQGlvbw3aENzV vmCCY2/n554MbBPpkY+BardgiVozBEqfEk+3AJvfGqX+ShUhBiPHFyJh24DjzpNq2lCQ pWKu06Wd81Km9ck92PRgyWVuhyjJT332A3vkGXrB7ICT8AtxIsU9r6+TdGH3zNtFdu29 4gUp4CASsOhXzUjLVuy+IhafYsXARityiZfStz1q42lRlFltHcq1lyMA94LTXkqLO9CI WcPpWRODSxADJ/2Dr3A+V9aqEii1wo2w+v74HVcLUUxg7Blf14WmgR8n2Ljo8Jkt1Wm+ sK1g== X-Gm-Message-State: AOJu0YzhQx1q5Gzyb3Gbo/jYZ5UovTgsVwJwoNwHT7xSGzlME203XWEz 2RRFUOy2aH8dAwoWZScjqhK1LN6yjIcnywl7zfJq0bLvNh2gsFYe+4sMElzXlq3QJtINxpkAMJy 0 X-Gm-Gg: ASbGncu9ztUn7sXZ4yv6J0juwTlQY0iYTpketK/AOT9IS1QjCI924yASNhOcwQzJh1t D2ch0qX3laRvWKbfwan9K2SyHseeJka3qTc39PRqKGtNkrAGUx+VDG2/em9aJjaF3HCstlZKMbo +2uKiHxS+r0Xr9+mr4Rym7rvcsNbrj48DAziNe6zMO9zLVMTtNFcThSy7uSTUWP6yvWNymH5d0X lhBOcY69tyH5FjEBtE3KUgaeFe7CMbP9OZNdQQpKy5ptIIHilSMPFeO67exDnxSjca7vSMmzKYA AsTZTlkhQHcJbA== X-Google-Smtp-Source: AGHT+IG9SX/NC/tgdWpseSoydoAm2c/uukvrBvBfQh3TiRyMsmIEBDiSH8xLmUgD8riF95Db7M2yLw== X-Received: by 2002:a17:90b:1dc9:b0:2eb:12b0:e948 with SMTP id 98e67ed59e1d1-2ee08eb2b30mr2619074a91.16.1732683554453; Tue, 26 Nov 2024 20:59:14 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee0fab78ebsm499032a91.45.2024.11.26.20.59.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:13 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVI-2JvO for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQfJ-2un6 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 23/40] dmesg: reduce noise from other tests Date: Wed, 27 Nov 2024 15:51:53 +1100 Message-ID: <20241127045403.3665299-24-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner dmesg records everything from every test concurrently running, so noise from other tests can cause multiple other tests to fail because they detect something from another test. Update the filter behaviour to minimise this crosstalk problem. Signed-off-by: Dave Chinner ` --- common/rc | 13 +++++++------ tests/generic/310 | 5 +---- tests/xfs/079 | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/common/rc b/common/rc index fdd18a386..3b4b9a59f 100644 --- a/common/rc +++ b/common/rc @@ -4591,6 +4591,7 @@ _check_dmesg_filter() grep -E -v -e "BUG: MAX_LOCKDEP_CHAIN_HLOCKS too low" \ -e "BUG: MAX_STACK_TRACE_ENTRIES too low" \ + -e "WARNING: Reset corrupted AGFL" \ $extra_filter } @@ -4613,18 +4614,18 @@ _check_dmesg() fi rm -f ${RESULT_DIR}/check_dmesg - # default filter is a simple cat command, caller could provide a - # customized filter and pass the name through the first argument, to - # filter out intentional WARNINGs or Oopses - local filter=${1:-_check_dmesg_filter} + # we always filter dmesg for global things that should not cause + # test failures. Custom filters are then applied afterwards. + _dmesg_since_test_start | _check_dmesg_filter > $seqres.dmesg + if [ -n "$1" ]; then + cat $seqres.dmesg | $1 > $seqres.dmesg + fi - _dmesg_since_test_start | $filter >$seqres.dmesg grep -E -q -e "kernel BUG at" \ -e "WARNING:" \ -e "\bBUG:" \ -e "Oops:" \ -e "possible recursive locking detected" \ - -e "Internal error" \ -e "(INFO|ERR): suspicious RCU usage" \ -e "INFO: possible circular locking dependency detected" \ -e "general protection fault:" \ diff --git a/tests/generic/310 b/tests/generic/310 index 1ae9e0233..1ab81dd2e 100755 --- a/tests/generic/310 +++ b/tests/generic/310 @@ -46,7 +46,6 @@ _require_test dmesg -c > /dev/null nr_bug=`dmesg | grep -c "kernel BUG"` -nr_error=`dmesg | grep -wc "error"` nr_null=`dmesg | grep -c "kernel NULL pointer dereference"` nr_warning=`dmesg | grep -c "^WARNING"` nr_lockdep=`dmesg | grep -c "possible recursive locking detected"` @@ -55,20 +54,18 @@ nr_lockdep=`dmesg | grep -c "possible recursive locking detected"` check_kernel_bug() { new_bug=`dmesg | grep -c "kernel BUG"` - new_error=`dmesg | grep -wc "error"` new_null=`dmesg | grep -c "kernel NULL pointer dereference"` new_warning=`dmesg | grep -c "^WARNING"` new_lockdep=`dmesg | grep -c "possible recursive locking detected"` # no kernel bug is detected - if [ $new_bug -eq $nr_bug -a $new_error -eq $nr_error -a \ + if [ $new_bug -eq $nr_bug -a \ $new_null -eq $nr_null -a $new_warning -eq $nr_warning -a \ $new_lockdep -eq $nr_lockdep ]; then return 0 fi nr_bug=$new_bug - nr_error=$new_error nr_null=$new_null nr_warning=$new_warning nr_lockdep=$new_lockdep diff --git a/tests/xfs/079 b/tests/xfs/079 index 4a1999bb8..3287a20fb 100755 --- a/tests/xfs/079 +++ b/tests/xfs/079 @@ -45,7 +45,7 @@ _try_scratch_mount "-o logbsize=64k" # The mount may not fail on v4 filesystems. Check for CRC mismatch warning # messages to detect failure in this case. -dmesg -c | grep XFS | grep CRC +_dmesg_since_test_start | grep "XFS $(_short_dev $SCRATCH_DEV)" | grep CRC # success, all done status=0 From patchwork Wed Nov 27 04:51:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886580 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21D759454 for ; Wed, 27 Nov 2024 05:00:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683616; cv=none; b=TmoOcKrWb5PKt5LXif46MwYxMC9yGF5hBtXrMRGwmfrmdmoTRohJcY7QtpD7BlV/5CckPO7I26iNOb96EEZmhDqVu42BS/2evJ6LGUibgCxElFpfsmogJBLdh0r3g7LeQv19SdpTtVFpuj0BRif6SUAnapz3AfZ/dzmXV6knzDs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683616; c=relaxed/simple; bh=VYHnI+EQ8RX3UxtqJmZ0XnEY8+UR8gb5bvTutYchgkw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mtbT7+/DHPiSl9ww2oeotNoNBSclSG1T+twN+9Q3v8LJ4A3dwksiMYKIP8HcLrrJw2Eg1rrLDNXGiLNUQ70aPYcYThDvRRrzWrVXK3Zs2HUQPcjWKpkvpyqYnVRSlKRQxVmoL5PN50k4f8SbFHLUXme7Q8B/hBMxqRq4irPlclU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=KNdx9kbj; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="KNdx9kbj" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-20cf3e36a76so59957315ad.0 for ; Tue, 26 Nov 2024 21:00:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683614; x=1733288414; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=cLMrktuCNGmFEoDqthJfXJDfe+SFyatGfYRpl7kApyQ=; b=KNdx9kbjhceEt/+LK5JqsBeVOdhqOpphTqKc2UCbVHMflWa1XtV7sy7ps7pt76tZIO cVmGuFSf8a9Yh3rKYEUVH40I038BkcY1hH0PAuUu+QJgRnuGJFCs/P1XRAXtR1UKZwic HK9x3MeI9ADCh9omFUqT683OPSowd2JtHdxGBXus7FAlZEvusyLoVfPHgiOO97MPNoWq 4hOcJFuogmdBGNEQvcyt3Os8AtTnRQNMfUVbCJLK9OaqFwEVXq4IW5rh7BxUxq84rJdN 5LDbFiHauFm+z6fvE18RtDhzke3CfBAV2ntDsQjgMX3Ut/uoE9a42z8I09hizVFbY28i d0Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683614; x=1733288414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cLMrktuCNGmFEoDqthJfXJDfe+SFyatGfYRpl7kApyQ=; b=oGQRLVp234byrW1ge4TY3SNwrfW0jMPMF3Dbsg3LhJIZ+mGiE7rR08GtC9hCbFbPp6 LqgHDw5NdWXkwbQJcrwtoeCO1ajRF69y7TREuXqhv/3NbS12mDst8JeYqiKzRUX3OW7s 1XHZD1Ya95eaN09iF+k3fem8Ctq+V8lRcdkSDiwJpxS742keDOFuGIjsjR2FB3+KZzv/ iqiu7j5BCONOB1LhFCu3Wr6GpeJHdjvRQZtcAOXFhzJg8VfQdBvAnCAt6N+GnofseLUJ ZfBAtftplbkIurO2fE1h0xwRcBHKNyrU/gW0NugorlMk/p6lZwL5ZtvGLt3YCsJOMlEU oFLg== X-Gm-Message-State: AOJu0YxAFeiPnj1fFi+moIwBq39Tkg9E7TDwRtSFJ//hzEZAoGQgPoqN SV/aHjETFRLi34RJX3clEQItkJQ5gGJV0jkUz65DNvZBAfXVPVfD5JbyQp7H9IYBhOG+FQPxev6 j X-Gm-Gg: ASbGnctY//BKe8BDrrI2zIFhh87UsBQt+wtkKgLgprGP6X0p1P6vYpsLjAu/eadyGqo aAf6j3L5NRHLep+dtCRlfHzYkslmh5rBhMRr1997sW9FsOkeRYPo8rFcxig9/Nn7OlEMIMnF3Y1 0XJLTpdZ1FZpQzhq7n8klPeU2JfqNd3CVlcMqOMSc82zpkNn2gQdaFrfLeKs1CXNLqyD3km8a60 J0vagg/n13rdJ2X859Kg6XgjxnSIy4tgubw0w1hsBY+54lqfCPOJCkBFSZxEwSuy1wsmH5PMiT3 VBFKAUKkRIYK8g== X-Google-Smtp-Source: AGHT+IFJtiuC+yNpBy3iRZyLNu5uhef34u+DTxDf90FyA2fHJezNU1c75bcj+1iwTvB+SJfVP7Q7Mg== X-Received: by 2002:a17:903:2441:b0:20c:ee48:94f3 with SMTP id d9443c01a7336-215010992a5mr20328155ad.14.1732683614281; Tue, 26 Nov 2024 21:00:14 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dc05fafsm93686325ad.163.2024.11.26.21.00.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 21:00:13 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVN-2Tc8 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQfN-32Yy for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 24/40] fstests: stop using /tmp directly Date: Wed, 27 Nov 2024 15:51:54 +1100 Message-ID: <20241127045403.3665299-25-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Tests should be using $tmp, not /tmp. this causes problems when multiple tests all use /tmp/foo as a temporary test state file and then step on each other. Note that there are some tests that use /tmp to store "test stop" files for background processes. Those that have proven to be unreliable at stopping tests when interrupted by ctrl-c are also updated to track and kill background processes in the cleanup function. Signed-off-by: Dave Chinner --- tests/generic/162 | 4 ++-- tests/generic/163 | 4 ++-- tests/generic/164 | 4 ++-- tests/generic/165 | 4 ++-- tests/generic/166 | 6 +++--- tests/generic/167 | 4 ++-- tests/generic/168 | 7 +++++-- tests/generic/170 | 7 +++++-- tests/generic/333 | 6 +++--- tests/generic/334 | 6 +++--- tests/generic/373 | 2 +- tests/generic/374 | 2 +- tests/generic/670 | 2 +- tests/generic/671 | 2 +- tests/generic/672 | 2 +- tests/generic/722 | 15 ++++----------- tests/xfs/601 | 2 +- 17 files changed, 39 insertions(+), 40 deletions(-) diff --git a/tests/generic/162 b/tests/generic/162 index e23014f03..25d2da7e0 100755 --- a/tests/generic/162 +++ b/tests/generic/162 @@ -15,7 +15,7 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - rm -rf $tmp.* $finished_file + rm -rf $tmp.* wait } @@ -30,7 +30,7 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file mkdir $testdir diff --git a/tests/generic/163 b/tests/generic/163 index 51a00e4b7..f80d699ac 100755 --- a/tests/generic/163 +++ b/tests/generic/163 @@ -15,7 +15,7 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - rm -rf $tmp.* $finished_file + rm -rf $tmp.* wait } @@ -30,7 +30,7 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file mkdir $testdir diff --git a/tests/generic/164 b/tests/generic/164 index e5c8acd02..f38e39868 100755 --- a/tests/generic/164 +++ b/tests/generic/164 @@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - rm -rf $tmp.* $finished_file + rm -rf $tmp.* wait } @@ -32,7 +32,7 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file mkdir $testdir diff --git a/tests/generic/165 b/tests/generic/165 index 0e565eb1d..128afbeaa 100755 --- a/tests/generic/165 +++ b/tests/generic/165 @@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - rm -rf $tmp.* $finished_file + rm -rf $tmp.* wait } @@ -33,7 +33,7 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file mkdir $testdir diff --git a/tests/generic/166 b/tests/generic/166 index 16157571f..4e0b19170 100755 --- a/tests/generic/166 +++ b/tests/generic/166 @@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - rm -rf $tmp.* $finished_file + rm -rf $tmp.* wait } @@ -33,8 +33,8 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished -do_snapshot=/tmp/snapshot +finished_file=$tmp.finished +do_snapshot=$tmp.snapshot rm -rf $finished_file mkdir $testdir diff --git a/tests/generic/167 b/tests/generic/167 index 0c3e20fe2..ceb53963f 100755 --- a/tests/generic/167 +++ b/tests/generic/167 @@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - rm -rf $tmp.* $finished_file + rm -rf $tmp.* wait } @@ -32,7 +32,7 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file mkdir $testdir diff --git a/tests/generic/168 b/tests/generic/168 index bd9859f73..d4b63cec8 100755 --- a/tests/generic/168 +++ b/tests/generic/168 @@ -16,7 +16,8 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - rm -rf $tmp.* $finished_file + rm -rf $tmp.* + [ -n "$write_pid" ] && kill -9 $write_pid > /dev/null 2>&1 wait } @@ -31,7 +32,7 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file mkdir $testdir @@ -57,6 +58,7 @@ overwrite() { echo "Reflink and write the target" overwrite & +write_pid=$! seq 1 10 | while read j; do seq 0 $nr_loops | while read i; do _reflink_range $testdir/file1 $((i * blksz)) \ @@ -66,6 +68,7 @@ seq 1 10 | while read j; do done touch $finished_file wait +unset write_pid # success, all done status=0 diff --git a/tests/generic/170 b/tests/generic/170 index 35b278b9f..be9cf7a18 100755 --- a/tests/generic/170 +++ b/tests/generic/170 @@ -16,7 +16,8 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - rm -rf $tmp.* $finished_file + rm -rf $tmp.* + [ -n "$write_pid" ] && kill -9 $write_pid > /dev/null 2>&1 wait } @@ -32,7 +33,7 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file mkdir $testdir @@ -58,6 +59,7 @@ overwrite() { echo "Reflink and dio write the target" overwrite & +write_pid=$! seq 1 10 | while read j; do seq 0 $nr_loops | while read i; do _reflink_range $testdir/file1 $((i * blksz)) \ @@ -67,6 +69,7 @@ seq 1 10 | while read j; do done touch $finished_file wait +unset write_pid # success, all done status=0 diff --git a/tests/generic/333 b/tests/generic/333 index 03a7bcd0e..220614147 100755 --- a/tests/generic/333 +++ b/tests/generic/333 @@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - rm -rf $tmp.* $finished_file $abort_file + rm -rf $tmp.* wait } @@ -33,9 +33,9 @@ _scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file -abort_file=/tmp/abort +abort_file=$tmp.abort rm -rf $abort_file mkdir $testdir diff --git a/tests/generic/334 b/tests/generic/334 index 3f9718476..0faa5d696 100755 --- a/tests/generic/334 +++ b/tests/generic/334 @@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - rm -rf $tmp.* $finished_file $abort_file + rm -rf $tmp.* wait } @@ -32,9 +32,9 @@ _scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file -abort_file=/tmp/abort +abort_file=$tmp.abort rm -rf $abort_file mkdir $testdir diff --git a/tests/generic/373 b/tests/generic/373 index e6334398f..04ec64251 100755 --- a/tests/generic/373 +++ b/tests/generic/373 @@ -32,7 +32,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -otherdir=/tmp/m.$seq +otherdir=$tmp.m.$seq othertestdir=$otherdir/test-$seq rm -rf $otherdir mkdir $otherdir diff --git a/tests/generic/374 b/tests/generic/374 index e56521aa0..9a85091e2 100755 --- a/tests/generic/374 +++ b/tests/generic/374 @@ -31,7 +31,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -otherdir=/tmp/m.$seq +otherdir=$tmp.m.$seq othertestdir=$otherdir/test-$seq rm -rf $otherdir mkdir $otherdir diff --git a/tests/generic/670 b/tests/generic/670 index 67a8f6fe2..f32199e70 100755 --- a/tests/generic/670 +++ b/tests/generic/670 @@ -23,7 +23,7 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file mkdir $testdir diff --git a/tests/generic/671 b/tests/generic/671 index f20069113..3abe12274 100755 --- a/tests/generic/671 +++ b/tests/generic/671 @@ -23,7 +23,7 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file mkdir $testdir diff --git a/tests/generic/672 b/tests/generic/672 index 832907de3..a5e65042e 100755 --- a/tests/generic/672 +++ b/tests/generic/672 @@ -22,7 +22,7 @@ _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq -finished_file=/tmp/finished +finished_file=$tmp.finished rm -rf $finished_file mkdir $testdir diff --git a/tests/generic/722 b/tests/generic/722 index 5542c045f..b9c608713 100755 --- a/tests/generic/722 +++ b/tests/generic/722 @@ -10,13 +10,6 @@ . ./common/preamble _begin_fstest auto quick fiexchange -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -r -f $tmp.* $dir -} - # Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +31,8 @@ old_a=$(md5sum $SCRATCH_MNT/a | awk '{print $1}') old_b=$(md5sum $SCRATCH_MNT/b | awk '{print $1}') echo "md5 a: $old_a md5 b: $old_b" >> $seqres.full -od -tx1 -Ad -c $SCRATCH_MNT/a > /tmp/a0 -od -tx1 -Ad -c $SCRATCH_MNT/b > /tmp/b0 +od -tx1 -Ad -c $SCRATCH_MNT/a > $tmp.a0 +od -tx1 -Ad -c $SCRATCH_MNT/b > $tmp.b0 echo swap >> $seqres.full $XFS_IO_PROG -c "exchangerange -f $SCRATCH_MNT/a" $SCRATCH_MNT/b @@ -53,8 +46,8 @@ echo "md5 a: $new_a md5 b: $new_b" >> $seqres.full test $old_a = $new_b || echo "scratch file B doesn't match old file A" test $old_b = $new_a || echo "scratch file A doesn't match old file B" -od -tx1 -Ad -c $SCRATCH_MNT/a > /tmp/a1 -od -tx1 -Ad -c $SCRATCH_MNT/b > /tmp/b1 +od -tx1 -Ad -c $SCRATCH_MNT/a > $tmp.a1 +od -tx1 -Ad -c $SCRATCH_MNT/b > $tmp.b1 # success, all done echo Silence is golden diff --git a/tests/xfs/601 b/tests/xfs/601 index bc8fa719b..df382402b 100755 --- a/tests/xfs/601 +++ b/tests/xfs/601 @@ -15,7 +15,7 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - rm -rf $tmp.* $testdir + rm -rf $tmp.* } # Import common functions. From patchwork Wed Nov 27 04:51:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886573 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A9C04689 for ; Wed, 27 Nov 2024 04:59:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683592; cv=none; b=ozonsjQn5TwF5LhtG4wN9fGI5fUrnd8P0NxWfdAXEJQCU3McgKUjye6J5PfoJ+FM7Nwr0kwCpj/zAzRc5XMUu6N4wXLZnyq7iAfQyv+lPERAq5R75ITw7lnkqKCKUGFhEEHkEzu3Nu1hM7+w9H7Km9/iQscUqiCcEt5Hjuo5I7s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683592; c=relaxed/simple; bh=dZpRjShA9rqZbr/Qn2hmDvT9o3P6Kf0mQjwcs3oAvAw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MdIdVP552yxXrxMMPBjnPZPc3lir8wlxpNhW0BgUycIWiirm3jrvfNFoTeBvkvi/o7PxpoYA/RLVVb5YIReOjqGlZqUimnSe1vTFOG6duT7BVrBsvSHvReUIApFRDQr/mmPKkwcJ4yUk8qXP4vL96aiaQoZBBmpPCScvkH2D9go= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=P3vOc5ja; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="P3vOc5ja" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-7252fba4de1so481911b3a.0 for ; Tue, 26 Nov 2024 20:59:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683590; x=1733288390; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zFhRJWPQzdgziYv2CJ1bBXezQi8XM59/tAhVcqaDgdE=; b=P3vOc5ja2OKALtgGu4s6wnE2O92aktfEmpGoZGDl31QVPWnOEmTWnxFCuZCyBYAa+g IvM/oGIRDdjno1tlgTSi4HJDx/KLkfP2a7Uuke4w9Lqct+LVE8wzP5ujunrxSpKkjaOG YCHLTZ0CU7IY4iA5UF11ej9aAjXrbFsmZJxwHndvLQReo40a6uQJaqEkxKjM7EyVJCs+ eZNxV2utMRe0IcRQk6193Is2jK1ViPUwcJpideTJP713viB2Rpx4K9xGqKnVXbqSKNmF uwPKiUcWDbOaKpqBO/txJUp51Xr4okOw4LSLotcmayxvfS9dC7t88vE1nddPrGv1Ymt8 LjxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683590; x=1733288390; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zFhRJWPQzdgziYv2CJ1bBXezQi8XM59/tAhVcqaDgdE=; b=EGHzJxiqQg1nHxIrZiavxqgNlMeA3oHaZ2bWWBgI2yHr8N8R1oIvGuWMzkK1kodsO/ QUATUB9qxK4ZFsO1LlkvvPfChJEZkd5O+Xx6iiG36bAcz34m93Afmdj+3NXKPiM3/t2q byqmoMi3gNrLHcrn2BCMAOKCsuqQRcMfR+OEJ3WnWYoc0rVxSvv+2Y62pyR3NAJ3oxOC EfjM6wompKLbwkC+Gv12MUeieUQgQ6R/PY4JE+gl1o++0Umb6CJRo+Gfj9t6d/KsDHmD RlUW053knaQAYBk5gf2wIjijhSLpr/UEoAcbswT3/1RKNjyzYkC+AUnBWsfpzz9b0IeZ 5GKg== X-Gm-Message-State: AOJu0YyqZBXRrZioRiGFFNpNbrB7jibv08eA1vHA0vm+/Qxg+XdRXuuG R5Vyxo8mqRdKRjVDvTfxoaBQe6/MPK5yjDuer98blNKepYNiTvv+Rtpfj3nlhakHAxAl58AJyIs T X-Gm-Gg: ASbGncsV1M2RgHjTeZF8eAaVy+3EKk+I0hrz/e3N9RpqONXQh/5pX8KKD+OwFEn63d0 DJPv5nBMOfF8bWqp2DiadRCB2cjj0jK7oZ6QmA7o9xRtoGuafi8XTNjG5kG/3UrfA7Lj9KzLHXy nt0Ji2O0SAsxe66xCIAUFdcl7128CRvhFjJ/AdVfgiiUyUGkXRXlL6q1tPY3tX4WO9WtAIukGO3 o/prbE0tnMh3kLdgcrsSVca9+j96qbRcCKbLQOvkk1TEgQI6u0s0o6qGLH2V6/aJ9bxrAo3BR/m prab8nZmfQtR9Q== X-Google-Smtp-Source: AGHT+IG16g1MBsQaPlUmXvXe7cT86nNIZT3CKlwcZI+DAw4ge4AV2lJLQPuRwHrTbSXREpiAC/TWQQ== X-Received: by 2002:a05:6a00:22d6:b0:71e:4296:2e with SMTP id d2e1a72fcca58-72530034bb8mr2037605b3a.11.1732683589723; Tue, 26 Nov 2024 20:59:49 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724de55862esm9345505b3a.155.2024.11.26.20.59.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:49 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVR-2hBd for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQfT-3CD4 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 25/40] fstests: scale some tests for high CPU count sanity Date: Wed, 27 Nov 2024 15:51:55 +1100 Message-ID: <20241127045403.3665299-26-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Several tests use lots of processes to stress the filesystem. many of them haven't really considered what this means for running the test on high CPU machines (e.g. >32p) and the potential contention and performance issues this might trigger. Some of these tests simply need to increase the size of the journal. Some need to run on filesystems with high inherent concurrency (e.g. larger AG count). Some need more efficient/faster file creation. And so on. This commit is a collection of those sorts of changes to improve runtimes on high CPU count machines. Signed-off-by: Dave Chinner --- src/aio-dio-regress/aio-last-ref-held-by-io.c | 5 ++++- tests/generic/251 | 5 ++++- tests/generic/323 | 7 +++++-- tests/generic/530 | 2 +- tests/generic/531 | 8 +++++++- tests/xfs/013 | 4 ++-- tests/xfs/076 | 6 +++--- tests/xfs/176 | 6 +++--- tests/xfs/297 | 4 +++- tests/xfs/501 | 2 +- tests/xfs/502 | 2 +- 11 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/aio-dio-regress/aio-last-ref-held-by-io.c b/src/aio-dio-regress/aio-last-ref-held-by-io.c index a70f2a9b7..7106e30a9 100644 --- a/src/aio-dio-regress/aio-last-ref-held-by-io.c +++ b/src/aio-dio-regress/aio-last-ref-held-by-io.c @@ -85,11 +85,14 @@ aio_test_thread(void *data) /* * Problems have been easier to trigger when spreading the * workload over the available CPUs. + * + * If CPU hotplug is active, this can randomly fail so dump the error + * to stderror so it can be filtered out easily by the caller. */ CPU_ZERO(&cpuset); CPU_SET(mycpu, &cpuset); if (sched_setaffinity(mytid, sizeof(cpuset), &cpuset)) { - printf("FAILED to set thread %d to run on cpu %ld\n", + fprintf(stderr, "FAILED to set thread %d to run on cpu %ld\n", mytid, mycpu); } diff --git a/tests/generic/251 b/tests/generic/251 index b432fb119..98986469e 100755 --- a/tests/generic/251 +++ b/tests/generic/251 @@ -175,9 +175,12 @@ nproc=20 # Copy $here to the scratch fs and make coipes of the replica. The fstests # output (and hence $seqres.full) could be in $here, so we need to snapshot # $here before computing file checksums. +# +# $here/* as the files to copy so we avoid any .git directory that might be +# much, much larger than the rest of the fstests source tree we are copying. content=$SCRATCH_MNT/orig mkdir -p $content -cp -axT $here/ $content/ +cp -ax $here/* $content/ mkdir -p $tmp diff --git a/tests/generic/323 b/tests/generic/323 index 457253fee..2dde04d06 100755 --- a/tests/generic/323 +++ b/tests/generic/323 @@ -23,12 +23,15 @@ _require_aiodio aio-last-ref-held-by-io testfile=$TEST_DIR/aio-testfile $XFS_IO_PROG -ftc "pwrite 0 10m" $testfile | _filter_xfs_io -$AIO_TEST 0 100 $testfile +# This can emit cpu affinity setting failures that aren't considered test +# failures but cause golden image failures. Redirect the test output to +# $seqres.full so that it is captured but doesn't directly cause test failures. +$AIO_TEST 0 100 $testfile 2>> $seqres.full if [ $? -ne 0 ]; then exit $status fi -$AIO_TEST 1 100 $testfile +$AIO_TEST 1 100 $testfile 2>> $seqres.full if [ $? -ne 0 ]; then exit $status fi diff --git a/tests/generic/530 b/tests/generic/530 index 2e47c3e0c..18256b870 100755 --- a/tests/generic/530 +++ b/tests/generic/530 @@ -22,7 +22,7 @@ _require_scratch_shutdown _require_metadata_journaling _require_test_program "t_open_tmpfiles" -_scratch_mkfs >> $seqres.full 2>&1 +_scratch_mkfs "-l size=256m" >> $seqres.full 2>&1 _scratch_mount # Set ULIMIT_NOFILE to min(file-max / 2, 50000 files per LOAD_FACTOR) diff --git a/tests/generic/531 b/tests/generic/531 index 0e3564fd4..ed6c3f911 100755 --- a/tests/generic/531 +++ b/tests/generic/531 @@ -21,7 +21,13 @@ _require_scratch _require_xfs_io_command "-T" _require_test_program "t_open_tmpfiles" -_scratch_mkfs >> $seqres.full 2>&1 +# On high CPU count machines, this runs a -lot- of create and unlink +# concurrency. Set the filesytsem up to handle this. +if [ $FSTYP = "xfs" ]; then + _scratch_mkfs "-d agcount=32" >> $seqres.full 2>&1 +else + _scratch_mkfs >> $seqres.full 2>&1 +fi _scratch_mount # Try to load up all the CPUs, two threads per CPU. diff --git a/tests/xfs/013 b/tests/xfs/013 index fd3d8c64c..5a92ef084 100755 --- a/tests/xfs/013 +++ b/tests/xfs/013 @@ -28,7 +28,7 @@ _create() mkdir -p $dir for i in $(seq 0 $count) do - touch $dir/$i 2>&1 | filter_enospc + echo -n > $dir/$i 2>&1 | filter_enospc done } @@ -42,7 +42,7 @@ _rand_replace() do file=$((RANDOM % count)) rm -f $dir/$file - touch $dir/$file 2>&1 | filter_enospc + echo -n > $dir/$file 2>&1 | filter_enospc done } diff --git a/tests/xfs/076 b/tests/xfs/076 index 840617ccb..e315a067c 100755 --- a/tests/xfs/076 +++ b/tests/xfs/076 @@ -47,10 +47,10 @@ _alloc_inodes() dir=$1 i=0 - while [ true ]; do - touch $dir/$i 2>> $seqres.full || break + ( while [ true ]; do + echo -n > $dir/$i || break i=$((i + 1)) - done + done ) >> $seqres.full 2>&1 } diff --git a/tests/xfs/176 b/tests/xfs/176 index 8e5951ec1..1aa8cde38 100755 --- a/tests/xfs/176 +++ b/tests/xfs/176 @@ -68,10 +68,10 @@ _alloc_inodes() dir=$1 i=0 - while [ true ]; do - echo -n > $dir/$i >> $seqres.full 2>&1 || break + ( while [ true ]; do + echo -n > $dir/$i || break i=$((i + 1)) - done + done ) >> $seqres.full 2>&1 } # Find a sparse inode cluster after logend_agno/logend_agino. diff --git a/tests/xfs/297 b/tests/xfs/297 index f9cd2ff12..af6af601a 100755 --- a/tests/xfs/297 +++ b/tests/xfs/297 @@ -34,7 +34,9 @@ _scratch_mount STRESS_DIR="$SCRATCH_MNT/testdir" mkdir -p $STRESS_DIR -_run_fsstress_bg -d $STRESS_DIR -n 1000 -p 1000 $FSSTRESS_AVOID +# turn off sync as this can lead to near deadlock conditions due to every +# fsstress process lockstepping against freeze on large CPU count machines +_run_fsstress_bg -d $STRESS_DIR -f sync=0 -n 1000 -p 1000 $FSSTRESS_AVOID # Freeze/unfreeze file system randomly echo "Start freeze/unfreeze randomly" | tee -a $seqres.full diff --git a/tests/xfs/501 b/tests/xfs/501 index 1da4cbf92..678c51b52 100755 --- a/tests/xfs/501 +++ b/tests/xfs/501 @@ -33,7 +33,7 @@ _require_xfs_sysfs debug/log_recovery_delay _require_scratch _require_test_program "t_open_tmpfiles" -_scratch_mkfs >> $seqres.full 2>&1 +_scratch_mkfs "-l size=256m" >> $seqres.full 2>&1 _scratch_mount # Set ULIMIT_NOFILE to min(file-max / 2, 30000 files per LOAD_FACTOR) diff --git a/tests/xfs/502 b/tests/xfs/502 index 52b8e95a2..10b0017f6 100755 --- a/tests/xfs/502 +++ b/tests/xfs/502 @@ -23,7 +23,7 @@ _require_xfs_io_error_injection "iunlink_fallback" _require_scratch _require_test_program "t_open_tmpfiles" -_scratch_mkfs | _filter_mkfs 2> $tmp.mkfs > /dev/null +_scratch_mkfs "-l size=256m" | _filter_mkfs 2> $tmp.mkfs > /dev/null cat $tmp.mkfs >> $seqres.full . $tmp.mkfs From patchwork Wed Nov 27 04:51:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886547 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD99F13C661 for ; Wed, 27 Nov 2024 04:54:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683252; cv=none; b=IsnSE8jBJsw3Y0/0mxwlD0Yxymnmb0lWzxIJgOOFkIMV+pq0VM21mKOclHjRaYNl6O8qk5GcgyU9izA4m8n4m8vd1oB9QZ0Gk8gjIr+pMl8xKLRROQFlzgUoTUnO7zZi3VYNTE0xniePcrWhY0dOahEJzSAVE6Rc3D125KVSKjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683252; c=relaxed/simple; bh=31+wezODfv0pTVCSdQQRtcm73s3T0h84iczEtGnaCc4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NUV8N7WWYxEpWURGxCEgq7UKUK24ruzQxUFdPm7xvO0Lt+/gOBUNV+5nOyV6Q425kaFD4oNlz3IXjOkTXexq2bZqCFvcYU6dVPqqv8p4+5OvyoR6ImyCYwLo4YR/yRKc6ZWfFkKt2utuTQZLCMWiR9MGpJS+oHUjRLIMK///AA0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=J++egDDh; arc=none smtp.client-ip=209.85.215.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="J++egDDh" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-7ee7e87f6e4so5249936a12.2 for ; Tue, 26 Nov 2024 20:54:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683250; x=1733288050; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Wy4IS/iZefcF4rH2xy70XIUO1t1F2MTEdWON+Bkp0Yw=; b=J++egDDh/LbVtsYy1Rmb4rSgL9TN8IBLW2mjYRytMTXKU7Vgs0gooib0P+PKRu/hOg BOKPyrkJR272bsyS5p4uSkYtcyU8aOfOml5NWaWlXP4IOaKzKaE3Lml/u0IDjwA66zmN sdwMpROquby+g6SRmKMpqw/UivV3q60PRYv/rUbHnzneJ/2gdhoLMwhkk729aoq9NYmn JMHFVggLnQ6REmFLs86+zPJIFotu9zzsCulYdP26+zjzazFI6UNbFxC2PdseJuL1/Qdt uuTWRRypdisqCPz1ngFSWLWLJ+4eaDMvNMvyzl9eTN42FS0TxSIqkyYnYnx708mbOZiY Wchg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683250; x=1733288050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wy4IS/iZefcF4rH2xy70XIUO1t1F2MTEdWON+Bkp0Yw=; b=VpHjL/ETbykHPKjXJshWe1ecpoDyEPwsSsWoOxxIsjOFr/pAe0EKNcmw/oJjvzd38W qBVuWlNR59Hx0TRQo9U8lRxSZZVYI+t7mFSUJrJmqelfbhRRLHtfwCNWq1iAiz3T5+12 sGlmoRcHEwPRXcjvuHKPMW7dlQmeEVBa238oJmPRAjdGfln1J0mqGGFVAKIjz7a9RSFe 1pWL1g0pW6PpBnjVD3iBccKWfj16mi9FFvNm+5F4mRYzos0xlznR1eAc26LuRJ7qpm7J upqQje4vFTId69QeNNqXD5qczyVHosMbHwTJNXA+big+0xTxU2YiTlPP0C5l3G9d5wFC e51g== X-Gm-Message-State: AOJu0Yx9+012wHpISxxpGNeINXx2xgJniAp7cq+ByC8Ns8aWm0roG+ZR 9FOoEfoSM4QV50OZ4PkFfIMenVF3m4vIiY9cHvdyO5j3qPXlKHJiyB1XIwfxwDg5fjlPGU27p86 V X-Gm-Gg: ASbGnctu8dw0RA2IB4m+gzXqvgovtBAAh0phlnXjViycMwgby+584f0DrQdYvTbShF7 9wLR2DLYcNI+cWHE6/kB4rK5YQfvykRq1E3av8aqnYTuQcnbGvBLkAZ8o5Msdx3YkrBasOsl1o+ CLhvZoZV/Sifb+l8kvB7cwmLaRoe7rabveEN2+Qunwgh6NTdpjPiixZT1ckuSjTsJStJA2Vf4B4 Z0YWLir52BLunU7DlaUuk1CWCtO8PI7Xv9x8OLd2wkbqeV7AtIh874ayeaVleTaUhTij1p8x9aE itgVOgPTKRaukkPUAPCjOfSh X-Google-Smtp-Source: AGHT+IFf1BmplZBCtZWk7NMOSgQxXOix6eRIKl2JgaCvqQWYOWG0d8UcN/ndsGxkAdLAcBIOYodroQ== X-Received: by 2002:a05:6a20:9f96:b0:1e0:da90:5f33 with SMTP id adf61e73a8af0-1e0e0b2352dmr2489293637.25.1732683250010; Tue, 26 Nov 2024 20:54:10 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724de531247sm9566243b3a.104.2024.11.26.20.54.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:09 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVU-2lxT for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQfY-3L2o for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 26/40] generic/310: cleanup killing background processes Date: Wed, 27 Nov 2024 15:51:56 +1100 Message-ID: <20241127045403.3665299-27-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Use the trick we used with fsstress of copying the binary to a test specific name so that we can simply use pkill to reliably kill the background processes this test runs. Also use SIGPIPE to avoid bash from throwing out "Killed" errors. Signed-off-by: Dave Chinner --- tests/generic/310 | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tests/generic/310 b/tests/generic/310 index 1ab81dd2e..52babfdc8 100755 --- a/tests/generic/310 +++ b/tests/generic/310 @@ -29,11 +29,8 @@ _begin_fstest auto # Override the default cleanup function. _cleanup() { - if [ -n "$readdir_pid" ]; then - pkill --parent "$readdir_pid" t_readdir > /dev/null 2>&1 - kill -9 $readdir_pid > /dev/null 2>&1 - wait - fi + pkill -9 $seq.t_readdir > /dev/null 2>&1 + wait rm -rf $TEST_DIR/tmp rm -f $tmp.* } @@ -74,6 +71,8 @@ check_kernel_bug() RUN_TIME=$((30 * $TIME_FACTOR)) +cp $here/src/t_readdir_1 $TEST_DIR/$seq.t_readdir_1 +cp $here/src/t_readdir_2 $TEST_DIR/$seq.t_readdir_2 SEQ_DIR=$TEST_DIR/$seq mkdir -p $SEQ_DIR for n in {1..4096}; do @@ -82,12 +81,11 @@ done _test_read() { - $here/src/t_readdir_1 $SEQ_DIR > /dev/null 2>&1 & - readdir_pid=$! + $TEST_DIR/$seq.t_readdir_1 $SEQ_DIR > /dev/null 2>&1 & sleep $RUN_TIME - kill $readdir_pid - unset readdir_pid + pkill -PIPE $seq.t_readdir_1 wait + check_kernel_bug if [ $? -ne 0 ]; then _fatal "kernel bug detected, check dmesg for more infomation." @@ -96,11 +94,10 @@ _test_read() _test_lseek() { - $here/src/t_readdir_2 $SEQ_DIR > /dev/null 2>&1 & + $TEST_DIR/$seq.t_readdir_2 $SEQ_DIR > /dev/null 2>&1 & readdir_pid=$! sleep $RUN_TIME - kill $readdir_pid - unset readdir_pid + pkill -PIPE $seq.t_readdir_2 wait check_kernel_bug From patchwork Wed Nov 27 04:51:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886571 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DE014689 for ; Wed, 27 Nov 2024 04:59:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683584; cv=none; b=KOLyf9syifDVuI2xSFRdr8cXjZcT1l7p+CLfeE09OyLlHru7fX15VdGQJ4/vWrSjxAdh8vSApsFHoLLQn6JxKDYSrh2zWvjNEOqdFgOieZT2EDqU2IJ3fqdH2xeP7OS0hwcjlUQpgWsKGpr/HVHWMDEW2P0kQC8hagbiUvd7qGw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683584; c=relaxed/simple; bh=CPKSGUSlagvlJWWk6OHPlBfiuqm09EOoBhJFYr6A7R0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZyKlii9JFXHtAGLWPK5fYolPxGL70kHa+hgUtJsVSsqJnDX7rjBLkuGgjH9vlbn5Y3vEgJUlZ1eTGnO0GsCru2sz2kdfjctQrlzDdz1moHPZ1NvGZpv4v5BTR1Tio1LmLiDKd8b8QP52SvChb+9CisBKyzn3NhSLlmADbGjKyCA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=f9bmTtMA; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="f9bmTtMA" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-21285c1b196so59644945ad.3 for ; Tue, 26 Nov 2024 20:59:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683583; x=1733288383; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=gH7lGQprZZCi6rCoGBTP87RrIO42NQIhzQJNGcRSjN8=; b=f9bmTtMAonJaf55k4a0NNVaddoAyREhf/7Bfsc0HBugS/RWc9UjET8uLZdrgc1MC61 B9Vzqik0rnO42dp6viLiOLHj+N9YzyoD+QEZ2dhgb1DohGIzKQkTQMxLN6VHX5Q5EpaY mCZcF6uEzKOfExZtjQ/lQYjwiUuDxtaj25kEhtqJdNKWFhbASx6KU/Hl5ApNtlAIZ1Hf HGCYNOE9Ii4oN5TGx14ZVrKHtQDcD0LxSeiqFTUK0uOkB6Objnr6cwws4fnbyjHK0tg3 XZGMsZaQOVY7fCWzUuM5Lx2vzxv9VqjMYLHWs1D52+rJvLM96ddvAfrGO1WKtmsJgSsK NVSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683583; x=1733288383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gH7lGQprZZCi6rCoGBTP87RrIO42NQIhzQJNGcRSjN8=; b=tT/9lPK7hCpcp9nsc/7L484PkTbmel4aOGBe/UWng9mmf+HmfkbWaq7g40oMPHeltD 6S2PX4Ks8IQfPTYRO5xsxGhsyP0RLlMYU1J6eatwotlEnfSYj3S3pp2GHthx/Gv50Jxs WjhNPdvcBVJTCa2QSWwlOnUA+zagkxGDfa61LH7NqT8Jp4mAaHYH5LxOIDHed91ykE8r V2179wN4HUfgnLV7lylUYAgHI3Rm/6M88NEG6fR8tc46vMXmTwZSKOVjuTEeFD4rd23w OZ20otL8ebqD8jsxKikr6uC5rQHZMWEkfVstpDJBq2k0lIwU4za7ecEG3XbTPMCOnWoR 1ScQ== X-Gm-Message-State: AOJu0Yxyvd9ZQ5Uz5PuO72R86lKwISt8P24LfwYW702ZpjcIjyePmzeq aXLj0r8BdxfnaToh7DkDr+aprzaqPNDyKKeIiSAoBqYnPdkjj+54d+Tyf3mMFE09TCyA2mpP/K0 u X-Gm-Gg: ASbGncvi057IEqfu2palUFrNGtYpkRRViTT80oSok0i9Jwmcewd+2i1DTJ7n2nFGQoJ 2Q7OY9r1s9YWC1cCsSTtPLLB61ARSfTGQ0DR22q2K8qpRzXamDlLxbbToq55Gld0DQZrCWV+zIw i8oHZEqfKYyWwig6whAf+lueELpPGq5+88qORssWQBcFzz8sC+rxvkkQ3uRgRarZrxS+agpwqYn 6v69654bwuQElbiczVXifjuiXtsQiZysWoO4Xr7gsOSSYMOujPi8BCB7Kfn45DfQHLUVu5dUqsw IOiDGxiR+8XnnQ== X-Google-Smtp-Source: AGHT+IFzHTL6K/w1zAWBZ2j07TY4HMli8FSYVftG0EE2IhTZ3tohIQUJTT8WdlW5YHaa+wGOB3+lDw== X-Received: by 2002:a17:903:22c1:b0:20c:d469:ba95 with SMTP id d9443c01a7336-2150109b400mr19530605ad.16.1732683582661; Tue, 26 Nov 2024 20:59:42 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dba3625sm94091085ad.95.2024.11.26.20.59.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:42 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVY-2uNg for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQfc-3TKg for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 27/40] filter: handle mount errors from CONFIG_BLK_DEV_WRITE_MOUNTED=y Date: Wed, 27 Nov 2024 15:51:57 +1100 Message-ID: <20241127045403.3665299-28-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Kernels post 6.x may have CONFIG_BLK_DEV_WRITE_MOUNTED=y which prevents mount from opening the block device on a mounted filesystem. This results in an error such as: mount: : Can't open blockdev which is not the error that callers of _filter_error_mount() are looking for. It is, however, a direct result of the test trying to mount an alreayd mounted filesystem, so it is reflecting the same error case. Hence this mismatch in errors should not fail the test. Catch this mount error and convert it to the expected "already mounted" error for the tests that exercise this behaviour. There is also a minor test change here to push mount failure information to $seqres.full in the cases where mount errors occur. Signed-off-by: Dave Chinner --- common/filter | 8 +++++++- tests/xfs/154 | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/filter b/common/filter index 36d51bd95..6a509d8b5 100644 --- a/common/filter +++ b/common/filter @@ -430,6 +430,10 @@ _filter_ro_mount() { # v2.38 and later: # dmesg(1) may have more information after failed mount mount system call # +# Kernels post 6.x may have CONFIG_BLK_DEV_WRITE_MOUNTED=y which prevents mount +# from opening the block device on a mounted filesytsem: +# mount: : Can't open blockdev +# # This is also true for ESTALE error. So let's remove all the changing parts # and keep the 'prior to v2.21' format: # mount: Structure needs cleaning @@ -437,7 +441,9 @@ _filter_ro_mount() { _filter_error_mount() { grep -v "dmesg(1) may have more information after failed mount" | \ - sed -e "s/mount:\(.*failed:\)/mount:/" | _filter_ending_dot + sed -e "s/mount:\(.*failed:\)/mount:/" \ + -e "s/mount: SCRATCH_DEV: Can't open blockdev/mount: TEST_DIR\/extra_mnt: SCRATCH_DEV already mounted or mount point busy/" |\ + _filter_ending_dot } # Similar to _filter_error_mount, filter a busy mount output. diff --git a/tests/xfs/154 b/tests/xfs/154 index e8494bbd6..674d06784 100755 --- a/tests/xfs/154 +++ b/tests/xfs/154 @@ -46,6 +46,7 @@ test $? -eq 137 || echo "repair should have been killed??" _check_scratch_xfs_features NEEDSREPAIR _try_scratch_mount &> $tmp.mount res=$? +cat $tmp.mount >> $seqres.full _filter_error_mount < $tmp.mount if [ $res -eq 0 ]; then echo "Should not be able to mount after needsrepair crash" From patchwork Wed Nov 27 04:51:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886574 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 399BD4689 for ; Wed, 27 Nov 2024 04:59:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683595; cv=none; b=spVWLasAJSLWWO+16RJKK0wVCretE1DBmKMDSfd9ynLkuJH1DlbLIE1TiN34+LrunT4zxIC651Sx+jsFtYLE8oVfM1HyOSo2ke7e075iEnpdyZP1QCdJXHBi1kHgC9YMGwr8SiWF4TTYCezw9UPH0YrFoFxyExB8STBIzH0rFb4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683595; c=relaxed/simple; bh=qsDOs90tbFKMkSjFD1vivH1yiHV45TVQJboqPfYUnqg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nmT5F2s1Mtem61o/HBabmeSVYc8qZVn8Gba0/0j99i3lTh81jx5exxlscRwFvFPuAOTp3SJo1quiBttqK9KkrsWd+9YnZC/hHlEOPSDhWbEeY7+e81JT9Epresjrzz1WCQdvjRbqZOBfKwy2LZgdzkZymXnKDQvp0HzZW3qrwmo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=m9vY94EW; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="m9vY94EW" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-7fbd9be84bdso4007096a12.1 for ; Tue, 26 Nov 2024 20:59:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683593; x=1733288393; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9yaChzPeUEEdvJppXsfSKvUUHFTUb2ECavr4EKnFcoA=; b=m9vY94EWpTzPNFaCSQXPr/IVMPLY7I6eZIFVEn4nGg+ggXryz1FzYvcxDSyDERzw6X ashuHgOonPnyoKqxDgLu4iAvkT/cjE8GEUREZUg7yQGwUzexORF62opmgTn9ft/hjTER 7BxtMmhSmh1Uv3Lkx7DUSn55a5cYDrl/SbW84E3v2lDyaLrwYUEp38LnPzqezuSFzZ02 N9hAdv9VdOTJsmv2KFbh+0sTXADIGSXUFlc/aTyQ0ReQXYaFkW7epoyicStdcxXlT1vT 5sTmeGcM5n59NqyFPShddF9FXRpfiR/MS3Ruy9BPGHkdB+5e+cYLkr7O46WS/CRgYZC1 LXKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683593; x=1733288393; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9yaChzPeUEEdvJppXsfSKvUUHFTUb2ECavr4EKnFcoA=; b=f9A7Xp8RMMsoeSoJQz6YmPzuXePv3In3NuVgkIf4PA1XEuD6vk+I2PbAQiFjmepO0b 7Z+Dg+bpiG0v7VaV1ovesxCdfNzv5rKH5dJdsPvfxIQdIF6sZw2WfMB43oU8v/euMGg9 lY3OHGWA5X/aYGvri4Vniqc/nurvPuW3DtTzaczhlo5VGW675Jk325nOvbYTvszarZUe 9fkTYnpWbvx2AvWjHpAreFuJSf8n8qMwQXjJz8LIlPgsZhgXMA6C1Qffu0Mi/L7Gmwm8 E32h/e+97cpufw3k9m50XavsUCi56GoyaTrK1jecKbBv2JI/OXP/BH25rPMxIU/ONEIW wlYg== X-Gm-Message-State: AOJu0YxBAZ1+hNWhOL6akHtL3kMiVVj4O0tarwv4LSJioCAPY02+qAtO 4yCDMgDUlfZXrT6d3TcbqutXVHwcK8L7QZRvmUOS8bVkt1O9O8IgGQPSI/2P+3SKAx2LU80Z2A0 h X-Gm-Gg: ASbGncuT9R+oXxaCrE7ldCZ1vknKlwT0gr7gMJ1dUJtwE2F60Gi5r3ForJrJpbJUmsE BCYndKy2xf8P2EH6asiYS5jcdClUzp/GeJuz4PDl/dQu7Wl6TXvydrg+u1ifmVP8IiI1CV4YPvE 4WWh6iKULw72/8oaNTU59In7/pTTAO5FgznPhn9uSry6dxwxIYBHD7AuMbvJwcSZ8FZzP07/uOP qwsuOU3swagarJAhVNzj8zs89xCSxDaKZ8IpgvrhpB5ck0KGSIkZZqFf9m1m+jb1Xpa1zZTjCOK zSF8RNSpV9SR6A== X-Google-Smtp-Source: AGHT+IHw5xEbqQPAJBYoNNJducw7cpe9kL5Qa7E3RkSuXdyM20RYDNWTVMNyyVfhKpmi3lQkPC5lRw== X-Received: by 2002:a05:6a20:430d:b0:1e0:d24f:743b with SMTP id adf61e73a8af0-1e0e0b10809mr2565391637.21.1732683593557; Tue, 26 Nov 2024 20:59:53 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724e831919csm8743131b3a.21.2024.11.26.20.59.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:52 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVd-37MU for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQfh-3cNp for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 28/40] filters: add a filter that accepts EIO instead of other errors Date: Wed, 27 Nov 2024 15:51:58 +1100 Message-ID: <20241127045403.3665299-29-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Running a dm-flakey or dm-error test that loads a table that returns EIO to all IO and then running a command that is expected to fail with a specific error is racy. If there is memory pressure at the same time that the table is loaded, cached inodes can be turfed from memory and the command then needs to read the inode it is about to act on from disk again. This results in the inode read getting EIO and failing (e.g. xfs_io will return a stat() error) rather than having the desired operation fail. This results in spurious test failures that look like this: generic/331 - output mismatch (see /mnt/xfs/runner-41/results-2024-11-20-10:57:31/xfs/generic/331.out.bad) --- tests/generic/331.out 2022-12-21 15:53:25.487044098 +1100 +++ /mnt/xfs/runner-41/results-2024-11-20-10:57:31/xfs/generic/331.out.bad 2024-11-20 11:02:12.123572607 +1100 @@ -5,7 +5,8 @@ 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-331/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-331/file2 CoW and unmount -fdatasync: Input/output error +/mnt/xfs/runner-41/scratch/test-331/file2: Input/output error +stat: Input/output error Compare files ... Add a new "flakey EIO filter" that will catch -any- EIO error from the command and change it to the error we expected to see. Signed-off-by: Dave Chinner --- common/filter | 9 +++++++++ tests/btrfs/160 | 3 ++- tests/generic/252 | 3 ++- tests/generic/329 | 3 ++- tests/generic/331 | 5 +++-- tests/generic/484 | 3 ++- tests/generic/743 | 4 +++- tests/xfs/237 | 3 ++- tests/xfs/240 | 5 +++-- 9 files changed, 28 insertions(+), 10 deletions(-) diff --git a/common/filter b/common/filter index 6a509d8b5..7e02ded37 100644 --- a/common/filter +++ b/common/filter @@ -662,5 +662,14 @@ _filter_trailing_whitespace() sed -E -e "s/\s+$//" } +# Catch -any- EIO error regardless of it's source and replace it with the +# supplied error message. +_filter_flakey_EIO() +{ + local message="$*" + + sed -e "s#.*: Input\/output error#$message#" +} + # make sure this script returns success /bin/true diff --git a/tests/btrfs/160 b/tests/btrfs/160 index 04ed1f176..c4a01d330 100755 --- a/tests/btrfs/160 +++ b/tests/btrfs/160 @@ -66,7 +66,8 @@ _dmerror_load_working_table # open again and call fsync echo "The following fsync should fail with EIO:" -$XFS_IO_PROG -c fsync $testfile +$XFS_IO_PROG -c fsync $testfile |& \ + _filter_flakey_EIO "fsync: Input/output error" echo "done" # close file diff --git a/tests/generic/252 b/tests/generic/252 index ddf950e34..2ad0524c2 100755 --- a/tests/generic/252 +++ b/tests/generic/252 @@ -66,7 +66,8 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full _scratch_sync _dmerror_load_error_table -$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 |& \ + _filter_flakey_EIO "write missed bytes expect 8388608 got 0" _dmerror_load_working_table _dmerror_unmount _dmerror_mount diff --git a/tests/generic/329 b/tests/generic/329 index e4300f92c..96a5ad54c 100755 --- a/tests/generic/329 +++ b/tests/generic/329 @@ -59,7 +59,8 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full _scratch_sync _dmerror_load_error_table -$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 |& \ + _filter_flakey_EIO "write missed bytes expect 8388608 got 0" _dmerror_load_working_table _dmerror_unmount _dmerror_mount diff --git a/tests/generic/331 b/tests/generic/331 index fe12ec4eb..704bb1283 100755 --- a/tests/generic/331 +++ b/tests/generic/331 @@ -59,8 +59,9 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full _scratch_sync _dmerror_load_error_table -$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full -$XFS_IO_PROG -c "fdatasync" $testdir/file2 +$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full 2>&1 +$XFS_IO_PROG -c "fdatasync" $testdir/file2 |& \ + _filter_flakey_EIO "fdatasync: Input/output error" _dmerror_load_working_table _dmerror_unmount _dmerror_mount diff --git a/tests/generic/484 b/tests/generic/484 index 09c2c5598..ec50735a5 100755 --- a/tests/generic/484 +++ b/tests/generic/484 @@ -54,7 +54,8 @@ $XFS_IO_PROG -c "pwrite -W -q 0 $datalen" $testfile _dmerror_load_error_table # rewrite the data and call fdatasync -$XFS_IO_PROG -c "pwrite -w -q 0 $datalen" $testfile +$XFS_IO_PROG -c "pwrite -w -q 0 $datalen" $testfile |& \ + _filter_flakey_EIO "fdatasync: Input/output error" # heal the device error _dmerror_load_working_table diff --git a/tests/generic/743 b/tests/generic/743 index 228ba764e..efdeec82d 100755 --- a/tests/generic/743 +++ b/tests/generic/743 @@ -21,6 +21,7 @@ _cleanup() } # Import common functions. +. ./common/filter . ./common/dmerror _fixed_by_kernel_commit 631426ba1d45 \ @@ -55,7 +56,8 @@ _dmerror_mount stat "$SCRATCH_MNT/a" >> $seqres.full echo read with IO errors _dmerror_load_error_table -$TIMEOUT_PROG -s KILL 10s $XFS_IO_PROG -c "mmap -r 0 $filesz" -c "madvise -R 0 $filesz" "$SCRATCH_MNT/a" +$TIMEOUT_PROG -s KILL 10s $XFS_IO_PROG -c "mmap -r 0 $filesz" -c "madvise -R 0 $filesz" "$SCRATCH_MNT/a" |& \ + _filter_flakey_EIO "madvise: Bad address" _dmerror_load_working_table # success, all done diff --git a/tests/xfs/237 b/tests/xfs/237 index 91f56d6c1..eb5dc5d2f 100755 --- a/tests/xfs/237 +++ b/tests/xfs/237 @@ -68,7 +68,8 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full _scratch_sync _dmerror_load_error_table -$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 |& \ + _filter_flakey_EIO "write missed bytes expect 8388608 got 0" _dmerror_load_working_table _dmerror_unmount _dmerror_mount diff --git a/tests/xfs/240 b/tests/xfs/240 index e95cf3f5d..8916828a8 100755 --- a/tests/xfs/240 +++ b/tests/xfs/240 @@ -64,8 +64,9 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full _scratch_sync _dmerror_load_error_table -$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full -$XFS_IO_PROG -c "fdatasync" $testdir/file2 +$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full 2>&1 +$XFS_IO_PROG -c "fdatasync" $testdir/file2 |& \ + _filter_flakey_EIO "fdatasync: Input/output error" _dmerror_load_working_table _dmerror_unmount _dmerror_mount From patchwork Wed Nov 27 04:51:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886569 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 726174689 for ; Wed, 27 Nov 2024 04:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683577; cv=none; b=AQFj2MwUULmuYYZvE5h0LXSC2H/JJBwlrDzd63ag6m8pLSbJkThnLgftLfkp51DG3FlQPGCSX5S8AXTdgKMpPedCMZ8tmJsot8X5c532jvqb1/ZwVjUjhOZuj4tKjB9hvNl0lkjVHDyYWgX3IlkToTWCqrmF4gXIoKeKhgHAcco= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683577; c=relaxed/simple; bh=Fjhq6mjr43d7UOVg7y101Ya4UzJYpqQYQcOcS4bzXTA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f20ZUNXOJ5M6Yxu7qOgJvnRT8jvQFZGhsRAcAiBH0H3fknZWtCJYxm29HXmVomDrl5YzjrIVY3fepBHXh2P98C73UN1m1t+1S528OQjprHhO8k5g5/czj40gi++2Gmesc1m32/EuVHlBG8KTpbwmUxe0pV0RHZLFopBEbVUtV5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=hnCrVSiz; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="hnCrVSiz" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-7251ce598adso1348740b3a.0 for ; Tue, 26 Nov 2024 20:59:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683576; x=1733288376; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=uO17thinb1mTZm6rxzipVuysiU7uoslnytn3CIiThlc=; b=hnCrVSizlQcG708cEDqbCK82l8ICxZgci7LhgTWQsWmDgEyL2oo9ruHWU94bSqpYNx HdSxJ+9rb7QCwsK39I07pEvTSDKfniRMuw6VHHhGX/sKrX0xXjJmiXlG/SnrjFNBJrRD b22DoEltgA5KtUsnErlnYMlKzrmHqexhkw/z9QPplavgrU3Sf2ZZ1iFyl8PZDFR3BKJi h9ZHY5UVQc0X/MOZqbdRUQcvw6LctytqiCaVQslPFGylcib5qCybabz+SRIMhvcfjTJq /tRQSDLgap6wVge43bNTEKjq1/b5JFgyX4zQg5scMUudcody6K+X064DOqLgKLPRC2Wu XRjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683576; x=1733288376; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uO17thinb1mTZm6rxzipVuysiU7uoslnytn3CIiThlc=; b=X3enH9nQKOTmkDrA2bhmwJL61FLWv3rGbejfcKmLossHWPGkDBw19oMlZcYj4rWdUL L2rUqRj34GFxWVPrMnxucbHquT52cNX+KgFT3EBD7DHTKUUp2P6nnzJMG6EFqcAJA2wP 8YFx2KLshlFo9TEwA3wRZN/TrYW/aJdrqkSpEcFdbvzdNYbkhclirRnpuh/WpJpI3Txt 2SxkGrHdUbhsRtPp9BAUCqeLpDAcZLhooVsOjStgqJKhYA5Y0r2EvyjvKZXN/T+ErSoK 8TJyBW+RmlY4ZcQCtXshlp/n60RewKkfanMvzUh1yd/Y+y2oVYPabNiHC/mUlU4x8c8Y aBRQ== X-Gm-Message-State: AOJu0YzRUp7c2uyX8h/lGn1bLvmqoZO0cjxInT7v6fRr+YqYBSm9U8sR DNi+23dSCgWV/vc+yS5PXmJS3mpfJFrkK3lvRMbDML/aL4jGcOyfIHLnMaToLOEZSwiYQdQcUZL j X-Gm-Gg: ASbGncuL3esrG2JeNVjr3PkIdHFGLRAUYYMzVf5gURoIzCdqF2fzqkLIHWwYeIu4EIy zo41IQB5WorvweIpYW6d/LM4KCaa3aXVkSwv4GLqjcFMLpiLmrVSHg3h1+KbF/5SdgwzutRS2Sx NIKOUu41sPT0QeY1ipB5V1jsIjOXRm1JApUileKrh/ZZnJh+xJGtRSqj7B24xHqozJNwx7zgzII tlGJWxf4jl6/3X3xoqFNClFtZ9yffX7zijokIuZf9C2ag4897Ykjh7zXZmJF0ZxS+QVxv4VfsoE dR1Mm378KohFRQ== X-Google-Smtp-Source: AGHT+IHISm+u1rLHkVYllNeUVbS2doPfFz0eYVsyxK7bJ03yoKM3mafAtGVFzcyuZs0KSZ2+B8wcTA== X-Received: by 2002:a05:6a00:2351:b0:724:67dd:2615 with SMTP id d2e1a72fcca58-7253015446amr2597043b3a.22.1732683575860; Tue, 26 Nov 2024 20:59:35 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724de531308sm9290309b3a.110.2024.11.26.20.59.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:35 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVf-3BOz for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQfn-3lTV for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 29/40] generic/085: general cleanup for reliability and debugging Date: Wed, 27 Nov 2024 15:51:59 +1100 Message-ID: <20241127045403.3665299-30-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner This test was quite unreliable during development of the parallel check runner. It redirects all errors to /dev/null, so there was no way to debug it when it failed. Use common mount/unmount helpers, redirect errors to $seqres.full, make sure the cleanup code is always run at test exit and only attempt to kill processes if they are still running during cleanup. Signed-off-by: Dave Chinner --- tests/generic/085 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/generic/085 b/tests/generic/085 index 8fbcdce2e..7671a36ab 100755 --- a/tests/generic/085 +++ b/tests/generic/085 @@ -16,18 +16,20 @@ _begin_fstest auto freeze mount # Override the default cleanup function. _cleanup() { + cleanup_dmdev cd / rm -f $tmp.* - cleanup_dmdev } cleanup_dmdev() { + if [ -n "$pid" ]; then + kill -9 $pid 2>> $seqres.full + wait $pid 2>> $seqres.full + fi # in case it's still suspended and/or mounted - $DMSETUP_PROG resume $lvdev >/dev/null 2>&1 - [ -n "$pid" ] && kill -9 $pid 2>/dev/null - wait $pid - _unmount $lvdev >/dev/null 2>&1 + $DMSETUP_PROG resume $lvdev >> $seqres.full 2>&1 + _unmount -q $SCRATCH_MNT _dmsetup_remove $node } @@ -64,18 +66,19 @@ setup_dmdev # important, as long as they're racing with each other. So just throw away the # outputs and ignore the results. for ((i=0; i<100; i++)); do - $DMSETUP_PROG suspend $lvdev >/dev/null 2>&1 - $DMSETUP_PROG resume $lvdev >/dev/null 2>&1 + $DMSETUP_PROG suspend $lvdev >> $seqres.full 2>&1 + $DMSETUP_PROG resume $lvdev >> $seqres.full 2>&1 done & pid=$! for ((i=0; i<100; i++)); do - _mount $lvdev $SCRATCH_MNT >/dev/null 2>&1 - _unmount $lvdev >/dev/null 2>&1 + _mount $lvdev $SCRATCH_MNT >> $seqres.full 2>&1 + _unmount $lvdev >> $seqres.full 2>&1 done & pid="$pid $!" wait $pid unset pid +cleanup_dmdev status=0 exit From patchwork Wed Nov 27 04:52:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886567 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C9C44689 for ; Wed, 27 Nov 2024 04:59:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683570; cv=none; b=pqdB/BNQW4grrbfe0zCyCJt16WmisLEPGHLfKZws4Bfw1r+yyM8Rnc83FLaI5YJ61kPtwE5Peo3TV6WwbXhu/i4/KbS4+iBC9cxafmP/NOQiI4SbJ+riq9AqZoum53H1V6Md85jq5eBNNq3if7Y25GcLZFJE7Y9Q0WxuL9QgWR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683570; c=relaxed/simple; bh=++7fozUmms/ppKTp63+6ZGXyROWVpqRR6H0bzZuHPxY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BS2ULPLU9N1HMI6NZCh3PXgY6E8EuoMG7kG/Uvw2ReRF03W7K3E38pLxnksqOvf5eyQO2sW+2ctLw7BxxOG2jPsbo9Qe2YPwPGjYZQBxamA5NkcEo2E9a94biZfLWoJ1P2y4izOIhIO7c0dM0XeItI9a7WVoTU8HJOS2G8jrX0E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=Vrd7etST; arc=none smtp.client-ip=209.85.215.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="Vrd7etST" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-7f8b01bd40dso333542a12.0 for ; Tue, 26 Nov 2024 20:59:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683569; x=1733288369; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8UEtav4jvo3xmiP8Wb5ihw9RJ6U2RCGLJkgCDkUUrHE=; b=Vrd7etST0vAyLDpTpFDfjhcgmUEcTFHyFW1BxhKYjii+9QDHeiqrbt/2RyoAnh7g/N kuIjelwz6IHBJuJB1wVX83S/C9wieb/JcFPWiAbz8t981HSa6NWSkIZrgaIeXKD/OwYz Rv7LqyaaZJNLEiy64hMh+fw4ueiGcgfL4rhQXZ0aiiWp4wGfFInOXgmDt9yVl1nXXJCK eLc4Fn3wgPpRbOF1I+iRaKTTy9fXwjok+4V4fRLup8HSqKbYFXqYxC7j8rdBFcfy68io r8Q0HdLAvyAmTQjw9BGYTwCuo+qpqzbTZiKUib+4+yG1U6NpUpzOpYn4hFxdM0EhCK5W vO8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683569; x=1733288369; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8UEtav4jvo3xmiP8Wb5ihw9RJ6U2RCGLJkgCDkUUrHE=; b=uH2IAT6lXpPR/4GDSbo1AjirK12L7qlHPqTnlLEygLyUBfhKpXuDl5EY69eYvFE+Lu SxWNq4FZFCk9uuVkAjN+4GyG2MCUSeAJYishaMlhhz97YZUYBw5cU4eaFDjRY4zwHWSp DKUNmEzprXzhO9iKoKDI1IVI+vIAx5SG1e6i8OBKfM0he6F3CmXDTQ8kkCVyLSD+wwD3 uG8kPrW+S00TU1hu0Wm0GR0K8PTr/oKlGUq9T8vu3EHj8N5wBBei/9peeGA0jgiiH2PQ 2tiOTCGmaS0rULF4eO71IaNOA64phbIlLa9Kuz2+i4ligFQVxqled7A9Yh0glskc/MJX 9vJw== X-Gm-Message-State: AOJu0YzEUB24AfigWbuuCLyxV9F2gu5bnRVKGUyJ1YlXEGjNvVMDwMtO CvifEqot7t+/rzOETLPHnjllnaxq6cfk0zFwPlH59pZbESDKL2B4LHj4x8vQWCZJqOV/OLnOR+k b X-Gm-Gg: ASbGncuyszFJFxSo32k9vRBVsr0e/2JFque8csRUKVNKRq+HHBA9KDh/7jFqwuRw0lU 0ZrPwQ071jI4aUS8eyYFttR/fw9/ZfadSa4lWJqjrEEi4V7WKs3SzP+10C+iOtBc5m38p9B99Rg xOTuu4kEs4bZjIIBlTYuT2LyEHk+Rb6PDGekrAEXUtYb/rOS8piE9wJOsCa87JWiGzNb3MKRZw2 Bbouz96T1NeIj8V3/V2iYUZCnhQDDSkvnjyW5L0xkZLEFVMscLk6J9ynq6hzcwYl6m4C3pa8ftZ IU6FGfcDHkXMYQ== X-Google-Smtp-Source: AGHT+IFnPlbr21+IqC+3jBCGGtpxckZxH6dZnzsuvIZ549aO7+f6HEO00XJ2KavLlB9atttTrv8bDw== X-Received: by 2002:a17:902:e549:b0:211:74be:c09b with SMTP id d9443c01a7336-214e6ec3d8amr91512515ad.12.1732683568819; Tue, 26 Nov 2024 20:59:28 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dba60dfsm93734975ad.106.2024.11.26.20.59.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:28 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVk-3HJl for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQfr-3tBo for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 30/40] fstests: don't use directory stacks Date: Wed, 27 Nov 2024 15:52:00 +1100 Message-ID: <20241127045403.3665299-31-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Using bash directory stacking (pushd, popd, etc) seems to be somewhat unreliable. I've been seeing occasional random failures from both pushd and popd commands that cause the test to fail, and there does not appear to be any reason for the failures occurring. Rather than wasting time chasing ghosts, just get rid of the directory stacking altogether. Signed-off-by: Dave Chinner --- tests/generic/099 | 8 +++----- tests/generic/109 | 5 +---- tests/generic/135 | 24 +++++++++++------------- tests/generic/707 | 7 ++++--- 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/tests/generic/099 b/tests/generic/099 index c7d5932b6..980fd38f3 100755 --- a/tests/generic/099 +++ b/tests/generic/099 @@ -253,15 +253,13 @@ echo "" echo "=== Recursive change ACL ===" rm -fr root mkdir root -pushd root >/dev/null # create an arbitrary little tree -for i in 1 2 3 4 5 6 7 8 9 0 -do +( cd root ; for i in 1 2 3 4 5 6 7 8 9 0; do mkdir -p a/$i mkdir -p b/c$i/$i touch a/$i/mumble -done -popd >/dev/null +done ) + chown -R 12345:54321 root echo "Change #1..." _runas -u 12345 -g 54321 -- chacl -r u::rwx,g::-w-,o::--x root diff --git a/tests/generic/109 b/tests/generic/109 index 2b0b438cf..894e07167 100755 --- a/tests/generic/109 +++ b/tests/generic/109 @@ -54,10 +54,7 @@ _scratch_mount >> $seqres.full 2>&1 # Test different directory sizes to test various directory formats for f in 1 2 3 4 5 8 12 18 27 40 60 90 135 202 303 454 681 1020 1530 2295; do mkdir $SCRATCH_MNT/dir$f - pushd $SCRATCH_MNT/dir$f >/dev/null - filldir $f - renamedir - popd >/dev/null + ( cd $SCRATCH_MNT/dir$f ; filldir $f ; renamedir ) done status=0 diff --git a/tests/generic/135 b/tests/generic/135 index 30c52af72..cb9407fdf 100755 --- a/tests/generic/135 +++ b/tests/generic/135 @@ -21,30 +21,28 @@ _scratch_mount cd $SCRATCH_MNT # create file with async I/O -$XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x12 0 4k' async_file > /dev/null +$XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x12 0 4k' $SCRATCH_MNT/async_file > /dev/null # create file with sync I/O -$XFS_IO_PROG -f -s -c 'pwrite -b 4k -S 0x34 0 4k' sync_file > /dev/null +$XFS_IO_PROG -f -s -c 'pwrite -b 4k -S 0x34 0 4k' $SCRATCH_MNT/sync_file > /dev/null # create file with direct I/O -$XFS_IO_PROG -f -d -c 'pwrite -b 4k -S 0x56 0 4k' direct_file > /dev/null +$XFS_IO_PROG -f -d -c 'pwrite -b 4k -S 0x56 0 4k' $SCRATCH_MNT/direct_file > /dev/null # create file, truncate and then dirty again -$XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x78 0 4k' trunc_file > /dev/null -$XFS_IO_PROG -f -c 'truncate 2k' trunc_file > /dev/null -$XFS_IO_PROG -c 'pwrite 1k 0 1k' trunc_file > /dev/null +$XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x78 0 4k' $SCRATCH_MNT/trunc_file > /dev/null +$XFS_IO_PROG -f -c 'truncate 2k' $SCRATCH_MNT/trunc_file > /dev/null +$XFS_IO_PROG -c 'pwrite 1k 0 1k' $SCRATCH_MNT/trunc_file > /dev/null -pushd / > /dev/null _scratch_cycle_mount -popd > /dev/null # check file size and contents -od -Ad -x async_file -od -Ad -x sync_file -od -Ad -x direct_file -od -Ad -x trunc_file +od -Ad -x $SCRATCH_MNT/async_file +od -Ad -x $SCRATCH_MNT/sync_file +od -Ad -x $SCRATCH_MNT/direct_file +od -Ad -x $SCRATCH_MNT/trunc_file -rm -f async_file sync_file direct_file trunc_file +rm -f $SCRATCH_MNT/* status=0 exit diff --git a/tests/generic/707 b/tests/generic/707 index fd02eacf9..3d8fac4bd 100755 --- a/tests/generic/707 +++ b/tests/generic/707 @@ -42,7 +42,7 @@ create_files() # We use slightly longer file name to make directory grow faster and # hopefully convert between various types for (( i = 0; i < $files; i++ )); do - touch somewhatlongerfilename$i + echo -n > somewhatlongerfilename$i done } @@ -50,12 +50,13 @@ for (( i = 0; i <= $moves; i++ )); do mkdir $SCRATCH_MNT/dir$i done +start_dir=$PWD for (( l = 0; l < $loops; l++ )); do mkdir $SCRATCH_MNT/dir0/dir - pushd $SCRATCH_MNT/dir0/dir &>/dev/null + cd $SCRATCH_MNT/dir0/dir create_files & BGPID=$! - popd &>/dev/null + cd $start_dir for (( i = 0; i < $moves; i++ )); do mv $SCRATCH_MNT/dir$i/dir $SCRATCH_MNT/dir$((i+1))/dir done From patchwork Wed Nov 27 04:52:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886577 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CED513D502 for ; Wed, 27 Nov 2024 05:00:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683605; cv=none; b=clRnPIBr8ypZ2Tt/Vo4q/lEg+OoqIgWvp5RFrUcFGnDfVqfhMKLb40R7agQ5+eTC0oaW6nGfchAy+vz2Wn5K6GvICLqbjNYSl6v3uqB+PjFb/8ys60Yy/YihKw6a/lU/5KAWtUUIJF1aL5ZDwAODdR4nlrmAIi9VrE9Nmb6/tF4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683605; c=relaxed/simple; bh=HPU8/Dl60OUQhEO3ZB/NTOq/YNjWmyPeNd4FYbDA/KQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ghbRNe7eo7N+ZTHhpeX64ccOFjmX14VTZAe0TP2diwpoRoclng1Qgf0oxqSd249iBDsRQsPMSSwi9bs6hBouVdOrVf8CMY5ECDVLAHot9iUdrSwZqLACz10xva1ZFqtglDJO/MiZgX7o5Vnohjcj+gIa10VCIuxzkqG/hkV4Gng= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=YDDsdjEO; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="YDDsdjEO" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-7251abe0e69so2064809b3a.0 for ; Tue, 26 Nov 2024 21:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683604; x=1733288404; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FiJvkl4sWpc7nD13wqPuFC22qsq8ZAW0iNgH8B0Igv0=; b=YDDsdjEOgLeB7EjpoB5ZndJ/Qck7uNMlA1DVU78qbXl0x+kvVSEK+grNhEAlZpyip5 h4GUNPPX0HL5H4jq7kF4FkU8mtQ1x8Ll2hHSbPBtmIpdShqPeSlweMjeRqJE3fWKBDTu jLAS1WaOlEVqcYN9N4zOYixIQnSuP/q2MDwX5rTSzsZ5qaCL3pO9iGz9mbPVD61Nw6Ea ShiQwNULlIssVy2/4/XDL/xehaRPraD/O81WazBW6I5fyXumYa+NLrhv9Z4ewJxI7RlE 3ECDZTbvnx5FO08+Khs2YN1L6b85yuVNDDciiNJFrZXhFepdfMaMnsthLhyAb0AU/4AZ sBHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683604; x=1733288404; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FiJvkl4sWpc7nD13wqPuFC22qsq8ZAW0iNgH8B0Igv0=; b=L4dWeLIyzaM/+fXqiihS/afhOI1LtBKMDjDTZmaQjDvLCsBUE5i9Tdvs6UOrfEAr22 gCZjjekZcpxzLpX1pKe7VaTz91tmv1bHvCC2KyORIoIVDMhd+i5TkLZFhP97QWolygZ2 9R3SIqOCsHrhH91zLadWAIvsysWnIslGGGTf4jrwS9am+/Nran7zzq8EjAdn4gSoLd/H 5AZD5wSKromL4sMxeA1seiVIoavwy8eJoPHijvICNYWwIDh4nCW78224AIW3nW1TMbHm FejLR82p5f7/z7Q+mh7TL3QpPK/QWDUOQFtbZWU1xMq0LD0YAE9us3NICjnCIWzuy2iC ofVw== X-Gm-Message-State: AOJu0Yze1WyYJetm2YPznqSqUDHPnBjCqiQZaj9lZt1Yd6qjHTnGNikB v1CnV4AhgnI8b26+PQve/Jz/GQjaehUu/6cf15xFnASo4G/DsL1s/mJKY4YV9uZfT8zEeKzSBur S X-Gm-Gg: ASbGnctv4Eo3m8OMKTiIIjyPkoBGg+5lyi7Sc+6/Bz1NKfvMbcW9bwbxX38dFyYrDts PDPXapPWrUQJV+82tHur1yUqBSPmxb+3yGYBWmKNjOQtG6kFi00LJ2Xm+yqmug2PlJro1Xqg5i5 lJ8Czl38XTV2EoLfWISlQc/CjZcb1hPZ2oAcB0v47On+J9VgUq7UBZkijeSC+TU66IyltYFD6Lq XdTiIxbYGv4/oyu/07bmG3LOcB9b1ah4b9lvOzec8PNHf0QDk20iTix+mYI5p3nXQsHtZrDeLep ayIHN0+mL+Ws3Q== X-Google-Smtp-Source: AGHT+IHjHGXn23NJ4gU18U2GLZxQwnGZjeT+GkcSjcyn09xa124HbP8TlnwiMPidcvWlzn1gtWBUoA== X-Received: by 2002:a17:90b:35cb:b0:2ea:6f19:180b with SMTP id 98e67ed59e1d1-2ee097cf0d5mr2119573a91.36.1732683603920; Tue, 26 Nov 2024 21:00:03 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee0fa48134sm500995a91.18.2024.11.26.21.00.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 21:00:03 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVp-3Ri0 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQfw-40VZ for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:05 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 31/40] fstests: clean up a couple of dm-flakey tests Date: Wed, 27 Nov 2024 15:52:01 +1100 Message-ID: <20241127045403.3665299-32-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Just little things I've found that should be cleaned up. Signed-off-by: Dave Chinner --- tests/generic/066 | 3 +++ tests/generic/321 | 4 +++- tests/xfs/051 | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/generic/066 b/tests/generic/066 index 37d04e069..9e4047a11 100755 --- a/tests/generic/066 +++ b/tests/generic/066 @@ -24,6 +24,7 @@ _begin_fstest auto quick attr metadata log _cleanup() { _cleanup_flakey + cd / rm -f $tmp.* } @@ -88,5 +89,7 @@ _flakey_drop_and_remount echo "xattr names and values after second fsync log replay:" _getfattr --absolute-names --dump $SCRATCH_MNT/foobar | _filter_scratch +_unmount_flakey + status=0 exit diff --git a/tests/generic/321 b/tests/generic/321 index 73a892334..df8f13597 100755 --- a/tests/generic/321 +++ b/tests/generic/321 @@ -13,6 +13,8 @@ _begin_fstest auto quick metadata log _cleanup() { _cleanup_flakey + cd / + rm -f $tmp.* } # Import common functions. @@ -57,7 +59,7 @@ _rename_test() $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/bar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/bar/foo - _flakey_drop_and_remount\ + _flakey_drop_and_remount _ls_l $SCRATCH_MNT | tail -n +2 | awk '{ print $1, $9 }' _ls_l $SCRATCH_MNT/bar | tail -n +2 | awk '{ print $1, $9 }' diff --git a/tests/xfs/051 b/tests/xfs/051 index fe3d75cab..ddc28ac97 100755 --- a/tests/xfs/051 +++ b/tests/xfs/051 @@ -11,6 +11,13 @@ . ./common/preamble _begin_fstest shutdown auto log metadata +_cleanup() +{ + _cleanup_flakey + cd / + rm -f $tmp.* +} + # Import common functions. . ./common/dmflakey From patchwork Wed Nov 27 04:52:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886579 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 261AEA41 for ; Wed, 27 Nov 2024 05:00:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683612; cv=none; b=sJbdTePC8DyB80wZWIEAWNjx/ck9krnc64iM/N5ZfDUpaLAXo4+wsazNb1nNQrpQsw8OS9HIiXH4Wm/A4541VEFrG9Vw46fgGaKeKrNVQKevZhuClrEvWtyjSpDJJ1OSuffEjHpc4c9OUaM5cjnFB3WqYfSVmqiI34VsfS7568M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683612; c=relaxed/simple; bh=lRFeb6yMAsD9VkPpbgKeBOkdSn5In1X0XHihMeFqH+s=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jlvKUr0V0/tnc+sgVDDqkVca3oOqyAVN0x+dyD9ifGplp4dJcW22UHw5bC3bXZP23yIPlE+Z/EHEXP7Kr0PLg8rY7bpmCMNU5ZHQfLUzT1Ei24QnvSA1eeCx9h5WNpXnz/IX+jGbpMSS475fULCE5vI/eB2au0V6YCcxKQehOfg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=WHdejhpR; arc=none smtp.client-ip=209.85.215.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="WHdejhpR" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-7f71f2b1370so5071435a12.1 for ; Tue, 26 Nov 2024 21:00:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683610; x=1733288410; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=lsQlWwV60sL+2ry2al+hCZ3ERzMnFh7RVOrbXT0yeSY=; b=WHdejhpR6Nc7aRp2y8ksmJ9d6104mj68rZ0mVZmpIBzjohh7q4oqsDIHQCYKHKlVd9 SdRe0LoVNrad3/3AiGQBrlHP1My9Tzpnqfm9CTxvwVYjqmnHk+S/mhaF7F5vM0rdXuV7 U9cHPAaRtrIXEAvnf/G5bMIuw/CpLLAiSv5ga/iDioCzXrwK+eLNFL7+RZqYZOiu2W9n kFZXl1LTQXxsGnDVuxywkZXkmtRdpp9ngqNAoQ2CW8RLKZsUG94VTEwS0I8zxhBQNtqN 2YwMXmDVGlQobP02ansRS5qwSUbpyl4pj5/sySStQJFicFfMwAfzVl+VxiBQQZLjKjMo Zfvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683610; x=1733288410; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lsQlWwV60sL+2ry2al+hCZ3ERzMnFh7RVOrbXT0yeSY=; b=oRTaxQNiJDldSgInH6ZfnPRJ2MFTp+yv7kMZdHc8JQLMZeDbJiuMdK5CWiGRKZ63l1 22nK7A655POSNtbPfSH10APKCDEp1Q1cpndJ1FU13TggohrpJmwFS0dCbquZyTKM2+4Y Bggv41LDLOMMmR5/CuOldSiTZE+pfca9xMZzxWTkO8/qj3SY+dGgGWaHoP8t6jWMdMNx 6Wp97NmEwP9buEvLdUBRtXbfxuqSHjEgh47EKLIH9cDFymgsduuQo52Vr0CyTvSj0y5w O7nE24pXBFsjsLsb3QhTV5cPPwe37psg4l6qj7Q1MPaCexcnpOQQOhkRGBMG0AWgtL3o fZ0g== X-Gm-Message-State: AOJu0YwvdK0wsvP12oRwND+x4v4Pr0VU50YkEwIwng4zoCNpXTL1FFfD PndGMVIg6Lnsmh4lgRw2NeqMWE3hnz2GQeiB0rqMNZFfOcw5sJDHtn/c0ucobuYNivDoUFxXo/u m X-Gm-Gg: ASbGncvVnlAo3vrBBYahTq0XUZyyrhnvc/5noVo1B1+k7NVzVx9epQ+opB2I9jQM3yN WOrzSPlM6TCAOa847OLYb+h3u1YOt2gSORTvzYjZWCGcN+W9CWJgP7OvsOeQXgzSpbZLzR+fF5u o8t4351zUjs32V/img4Dvy2n26RX8Qa74V1/h1Dor9SuwGSrqe1KChQtn0T45e0OchnkHsRLI4I UN/pUa79+yC0xUX54NgXkXzaI2ez08t672DWRMUB/HSl8etWj2DNTvkNKGCm8J76YdMZtpCMMjR Ttcy+XqZv135tQ== X-Google-Smtp-Source: AGHT+IHTPhccw4nb+Qbgk5kxZD1BfVCJeE0nTSlyjzeFxXjqM8731GkPzdr3XI15bXfGJPm6TlWrTA== X-Received: by 2002:a05:6a21:3989:b0:1db:a33e:2c6 with SMTP id adf61e73a8af0-1e0e0b206dfmr3689969637.18.1732683610511; Tue, 26 Nov 2024 21:00:10 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724de573d37sm9277655b3a.174.2024.11.26.21.00.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 21:00:10 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVt-3cK8 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3x-0000000FQg2-4ArB for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 32/40] fstests: clean up termination of various tests Date: Wed, 27 Nov 2024 15:52:02 +1100 Message-ID: <20241127045403.3665299-33-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Accumulated minor fixes to improve reliablity of the termination of various tests when interrupted. Signed-off-by: Dave Chinner --- tests/generic/084 | 12 +++++++++--- tests/generic/464 | 10 +++++----- tests/generic/650 | 8 ++++---- tests/xfs/013 | 1 + tests/xfs/558 | 1 + 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/tests/generic/084 b/tests/generic/084 index 137ba23cf..fe758f118 100755 --- a/tests/generic/084 +++ b/tests/generic/084 @@ -12,6 +12,15 @@ . ./common/preamble _begin_fstest auto metadata quick +_cleanup() +{ + [ -n "$link_pids" ] && kill $link_pids + [ -n "$open_pid" ] && kill $open_pid + wait + cd / + rm -f $tmp.* +} + # Import common functions. . ./common/filter @@ -57,9 +66,6 @@ done & sleep 5 kill $! >/dev/null 2>&1 -kill $open_pid $link_pids >/dev/null 2>&1 -wait $open_pid $link_pids - # all done, no oops/hang expected, _check_filesystems checks SCRATCH_DEV after test status=0 exit diff --git a/tests/generic/464 b/tests/generic/464 index f114208f9..ebf475094 100755 --- a/tests/generic/464 +++ b/tests/generic/464 @@ -66,22 +66,22 @@ _scratch_mount # for each operation and runs for $LOOP_TIME seconds, and check filesystem # consistency after each iteration for i in `seq 1 $LOOP_CNT`; do - rm -f $stop + touch $stop for j in `seq 1 $PROC_CNT`; do - while [ ! -e $stop ]; do + while [ -e $stop ]; do do_write done & - while [ ! -e $stop ]; do + while [ -e $stop ]; do do_append done & - while [ ! -e $stop ]; do + while [ -e $stop ]; do do_writeback done & done sleep $LOOP_TIME - touch $stop + rm -f $stop wait _scratch_unmount diff --git a/tests/generic/650 b/tests/generic/650 index 36a23e48d..60f86fdf5 100755 --- a/tests/generic/650 +++ b/tests/generic/650 @@ -52,8 +52,6 @@ nr_hotplug_cpus="${#hotplug_cpus[@]}" test "$nr_hotplug_cpus" -gt 0 || _notrun "CPU hotplugging not supported" stress_dir="$TEST_DIR/$seq" -rm -r -f "$stress_dir" -mkdir -p "$stress_dir" echo "Silence is golden." @@ -79,12 +77,14 @@ fsstress_args+=(--duration="$((SOAK_DURATION / 10))") nr_ops=$((2500 * TIME_FACTOR)) fsstress_args+=(-n $nr_ops) for ((i = 0; i < 10; i++)); do - _run_fsstress_bg -w "${fsstress_args[@]}" - _wait_for_fsstress + rm -rf "$stress_dir" + mkdir -p "$stress_dir" + _run_fsstress "${fsstress_args[@]}" _test_cycle_mount done rm -f $sentinel_file +wait # success, all done status=0 diff --git a/tests/xfs/013 b/tests/xfs/013 index 5a92ef084..fd011445d 100755 --- a/tests/xfs/013 +++ b/tests/xfs/013 @@ -120,6 +120,7 @@ _kill_fsstress # clean out the competing fsstress allocations, then everything else rm -rf $SCRATCH_MNT/fsstress rm -rf $SCRATCH_MNT/dir* +wait _scratch_unmount diff --git a/tests/xfs/558 b/tests/xfs/558 index ba137ae8d..c594d8ccd 100755 --- a/tests/xfs/558 +++ b/tests/xfs/558 @@ -193,6 +193,7 @@ wait_for_errortag & $XFS_IO_PROG -c "pwrite -S 0x56 $((2 * blksz)) $((2 * blksz))" \ -c 'fsync' $SCRATCH_MNT/file >> $seqres.full rm -f $sentryfile +wait cat "$tracefile" >> $seqres.full grep -q iomap_invalid "$tracefile" From patchwork Wed Nov 27 04:52:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886562 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA3464689 for ; Wed, 27 Nov 2024 04:59:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683553; cv=none; b=JiDENKtpwPzRlsGkooOvVi77jOgr952WvB9F3CauVjefM+f5z+C/DSKIg/OekTHX0B2NzkM4x5FRsHpcCBKG8rfWpNuEUVtdGeh1o3o3/MtumHRdkR81zSfgOGDzG9t/DVopdVaZukjwvlDc/wiW1IhhMd/HssvHJTlDIbziW3s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683553; c=relaxed/simple; bh=bEWIKywlAbVNUj7Kq4YB68KU4RfpC7bLLiZ6fMXZ4aA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r/OgU2kE6tvHp/okQ38IGCndAkCrfyb0TUGM00P1NZuE648f+bFYf0qECw16GsmX8jaSMX98oMwHgLl76v77hKFsoHne2CV5Usv0rAhDNp5cYetYN84T/gvbWRCbwrODrVtMWFq6AT/GxlumLh2dDhQ/PxW5jRfAOELskXBto4o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=JHjg0pT1; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="JHjg0pT1" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2ea499f264fso324406a91.1 for ; Tue, 26 Nov 2024 20:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683551; x=1733288351; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xcV6O4rEnXb85dFkAiZQFzOKmP6sjZbfBJHSKwxpnm0=; b=JHjg0pT1Pb0VkmSPBIo7TwdzgQU1nLS6YOJ/M4G7NBUSMUa7BSzAII79ojD9zd/OcO S3Xw42qu2dSmEmbZ0DYaTmpr7XBtwGZodZvUAsHzUJ9fg2l8NkEapVm6EAbH2BoYOhRi /MEFg/QdDAEbAloOcGZpppXdpjcFlMymjjfWEqm6+0dlwUt0mmxXDiMetxRz/SwAj4nm vwEwZT9kmwpr9vIWc0AVYs4Mxtn0DwanYt3SaCMB3xCnT488/DcER0PMmg5Om/cftqAj FAjk+9tJVOWg8Lx/mpYISbaW5S48I0YM5F63CC9i9lCxDd5m8oNDkV7oA5ugkqKClkEW BYHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683551; x=1733288351; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xcV6O4rEnXb85dFkAiZQFzOKmP6sjZbfBJHSKwxpnm0=; b=IcNZ9WWw6n/WpkBuRtJ2furPVeP8t7jprBSAz/+Z/Q/S+z3ZAoTpysY5fpuMCW1nOM vqaEB+qvNM/tsahApKBiOk0B+IxvAEtobRRoHp9gq1wrbaojuxQ86CfrkaCKQL4x7dNq Uo7tIJbtR7kGL69ZvovOzaQLIHzFuwmCK+dUQR47O8JjQ/us2YkPc2DIe5mwEgzn9cSz NZogEpGTBClgoRvyuXu23unCeXuQoBo9h/fxlmBIbIJf/WM0kCm1hlVLoR0AJEqqi0ii Qk37j21OXJ+frEO4lcBpSYWurPnmU5bAefhUYzlNQpbNOnAHBylf2356tzazXywBEFFg DjJg== X-Gm-Message-State: AOJu0YwgkTkbExIUcUmun0cbI7CHJRYBOPSpa4iIVCbLt3zosKKyrTml Hb1E1ExJnQZ/zcfyjmPpS1z4afgOt0v7Jd7QgtVzKdRyM/84grujstqU/A3OljBIzAvBSD72PYU M X-Gm-Gg: ASbGncvRKwBStyIDcaQntTXlRRYJN9OaQCfIbTanwRE/AFUeY36bobrUuKiDTlerSjW XfTqmgkVYPatuYXZ2EMq+i17QbJ1MRWJpv3fwFV/SSadpMPeRgyHd/H8uDzCoAMr6hNu2eNns3/ +YzNSeaAnDJI1GIF3aTZANoH8PuWBZArE8gsU3JZBTIPrziOo8mtOVvxS1VT1PL7t4nNu29QewZ IgVpPEhUcVLTUWNqytMJAYhMa2Z7FyKJm3rVfvfmlB5loWj4JNPkqBIJUYj73zLSzEdYHxTOMnT Eo9DsGL5HtVILA== X-Google-Smtp-Source: AGHT+IF/UoY7lWhBwGx9YnpBXPxwazFF80LQzo297Y7ZfPLgq1OCnsus6YTnNT3uDHWL8IWeode17w== X-Received: by 2002:a17:90a:de98:b0:2ea:7bdd:f320 with SMTP id 98e67ed59e1d1-2edeb68cf73mr8721573a91.1.1732683551119; Tue, 26 Nov 2024 20:59:11 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee0fa66e87sm496374a91.23.2024.11.26.20.59.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:10 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZVw-3oI4 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3y-0000000FQg8-07k3 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 33/40] vfstests: some tests require the testdir to be shared Date: Wed, 27 Nov 2024 15:52:03 +1100 Message-ID: <20241127045403.3665299-34-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner This ensures that these tests will run successfully when the parallel check infrastructure makes all the scratch and test mounts private. Signed-off-by: Dave Chinner --- tests/generic/589 | 2 ++ tests/generic/632 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/generic/589 b/tests/generic/589 index b5860070b..0384083bb 100755 --- a/tests/generic/589 +++ b/tests/generic/589 @@ -164,7 +164,9 @@ move_test() move_run unbindable private } +_mount --make-shared $TEST_DIR move_test +_mount --make-private $TEST_DIR # success, all done status=0 diff --git a/tests/generic/632 b/tests/generic/632 index c7a1f1fad..c4d3555bc 100755 --- a/tests/generic/632 +++ b/tests/generic/632 @@ -22,8 +22,10 @@ _begin_fstest auto quick mount _require_test _require_test_program "detached_mounts_propagation" +_mount --make-shared $TEST_DIR $here/src/detached_mounts_propagation $TEST_DIR >> $seqres.full status=$? +_mount --make-private $TEST_DIR echo silence is golden exit From patchwork Wed Nov 27 04:52:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886561 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 653A34689 for ; Wed, 27 Nov 2024 04:59:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683549; cv=none; b=k+pcyqTW0N6DwqscTe6fyGhbvPw/SuqyRUMnW+CUCUOj5uf4RUCNwxgqFGPfm0aKmzq126Ctgv5PJPj1SN/lD5h2mhXjVIz6n1tTf2VhmqoqKi1rogLMG2NR+yaRewG5+5IznTKA3SgZI9S1UBq3YllhMcvvs0tOZN+hDSpBbDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683549; c=relaxed/simple; bh=vBrDAvGw569f9gYfc7PTPsc73tbloCuxkVFwbWK3z+A=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WgqroHBElev1u8gNDGL3wt+6/hq1ApbAL+DhLpeJ/uKP1XzK4VKVWoNkdrAxKTBkxfBSjT5gRqidcbDpOGZ/WwFc1CNrimCCS5StmgHGAbDSipa0rIVmer9cbbYVXwTFfcSnD5/MCDMFzfaQqR5ffFXz2tMcRCaD7YHWJ/EvjFI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=ImfY+H3o; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="ImfY+H3o" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-21207f0d949so60714185ad.2 for ; Tue, 26 Nov 2024 20:59:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683548; x=1733288348; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=XyXbpCk9ub9DUUkBl5poE/hnVuXSP9Y8jYRNxmrhev4=; b=ImfY+H3ow87sFjsVKbiB00Fr+ywOsoB3xn22CVGMoqUozmACawphCQO+Ke8x8IaYPM fQXguBdZpObDtiW0GHVxvs+EcUfosscY7dYwmhDj8kBbq5DZmYyIEpEGzxPNuN6HdG1Q 4OmjbfKe4HLb0lmCZVbXymsGpEE7b4zB0FWpb6zovMEctVWDdDsMCYPXD4mwhTQ/JTer TJiqBL0l6nKc9sl/5MIE50rmeKd/hWw304nLee31ECg746s/8NsvLIaqU6CEmFh2VDgu /WZGey2WP1K5SnUPI7WBQs/PuKpn1Ye8CubQGTjiqeY1Ppovee7g3xxgJ5NyrjU29KVJ oGlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683548; x=1733288348; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XyXbpCk9ub9DUUkBl5poE/hnVuXSP9Y8jYRNxmrhev4=; b=jI5OK7A2qC/U8pGjvRm2lfUm/nZpI9+rqgVFm6KRKK8y3vWskc32/vBDkVhsD/oFMb M5RbKxle62o4KWC2CMJ/XdN0y125UzpK/0CjOQ6+cMGUt59vvZygo/LO7RLOvcVyZ4Dl 0Ng1YsNbQDATVxIkBqBvRUm7miUfiQdA4okQyJaqE759P+1HS3f4E+ZLczrs/4DmY4XR BGDQ9YYMymsYp7RuJOGyZqf5BaziUwrAp4DGdXb+xDFi4nj+P36xIha3F5W1HZdZKELF 6JrbSYHklVnZYx41qsOoT88lUTdPpL8EJo4jw2zIEspavHPNlm0Gv7iPVY+7O5jNggey xg7A== X-Gm-Message-State: AOJu0YyzdI8apCZiT7GFyFRzVFBMdLvgo8bWBOKkbzMXufnKvmTC8q1c JSm11NoYzfhcbBo7Xn0gpoCmYCkXpXyeCP3hSpFat6MyvVxsiqg5QvV/uqj7vTIvxMeKIxpQ0Ue Y X-Gm-Gg: ASbGncuG9XMw7OOM74gTyiHw5I7SW/QfDAPenOurFkLK71KK3rOz4f0GKtfqQpo0fMl qnUWSOQhy15jQlUpjXosTaK5R8rSKOymJFn9f9c/DGepgtiNlR0om7YUGrIUvbR5JTSxA/BzcVx Hdir3oGGPT6XaRGK6ISFGaBfBsU4MpeKkwDULEnyoY/m/tJ43RTeYf0EC0LROY+MPQzY/d7i0aX U/d4nr6J0zCG8F0n3l/CN+qfZT+PGxqgImeQzWh57eC7pGvg9poVhDc26qciWjh2FxhYFPnNOeU NmczhnTIFdTO/Q== X-Google-Smtp-Source: AGHT+IEMUfpeUoM75pIYuVV129WvtKs2FnV1cb+VyXtU47oXDwh8PgoDKvSuTolcJe1UUPmqac37zQ== X-Received: by 2002:a17:902:b18b:b0:212:4ac2:4919 with SMTP id d9443c01a7336-215010994a5mr16552955ad.17.1732683547729; Tue, 26 Nov 2024 20:59:07 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dbfb30asm93956005ad.161.2024.11.26.20.59.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:07 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZW0-3uoz for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3y-0000000FQgD-0GkS for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 34/40] xfs/629: single extent files should be within tolerance Date: Wed, 27 Nov 2024 15:52:04 +1100 Message-ID: <20241127045403.3665299-35-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner The test passes if we have between 2 and 40 extents (despite what the comment says!), with the target being 20. There is absolutely no reason for considering a single extent file a failure - that indicates the filesystem completely defeated the fragmentation behaviour the test was trying to cause. Hence expand the range of "test pass" tolerance to 1-41 extents. Signed-off-by: Dave Chinner --- tests/xfs/629 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/xfs/629 b/tests/xfs/629 index 34b3ca0d6..a2f345571 100755 --- a/tests/xfs/629 +++ b/tests/xfs/629 @@ -59,8 +59,8 @@ _scratch_sync for ((n=0; n X-Patchwork-Id: 13886581 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6808E10E0 for ; Wed, 27 Nov 2024 05:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683619; cv=none; b=ZKp90zeQbBf8oXk+Yb3lC40M4R72AM4zfJyjVxLjlb+VsON8rAp060ub2HIOK4GvLaeracxSGUVeiJayW6XqXP2piV7Wo/8Rbxb9FhL5lkKYa2dn5NjgGYykDFxGugX6RAC8UKsCkZUyRQxukIzEjYiX80swAlqabAFkP7m/DtI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683619; c=relaxed/simple; bh=tMW5IA4gWYHrIishB2o5Fqp4DWrRYTODDnqH5SaacG8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DwttX+QVA5NDtsyTbT02Vi6QYYn2C6y2wl/UdCGy6uS6QRslp1WoN4S6gBw/fmyeUiUFiwRXdMn9lnCGhd3M8tpIxoONWxyMsbqFjuZHzPDN6nDmDQ9V6CdYk57ST8tpZpQda3CIj61Hlprc/zAB6vIuS9T4qgi7QCvrtj1uM54= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=LmYWQEiP; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="LmYWQEiP" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-21207f0d949so60719455ad.2 for ; Tue, 26 Nov 2024 21:00:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683618; x=1733288418; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=fOMvIhnFfNNITK55K9hXMMZ1nzXDoeNI+ouhBSMnChs=; b=LmYWQEiPEieIoaDrFjffQyh9YzeckvDg3q52I9w4wdreaoiNfbATxqp1ODGNq8M8nn sCCKUKPRMIOSs0ovQIqMd6+n+MY1GJWrYHUanAwLiefmLBxqTp6pJYzfVTgqd395sHzs wlX4C85/az9Oc9Tu4QqhXP6ZbIHyXldvRfvFRU7J2zpINqFaR0yrDZ69uV26iahwBiNm 4PgCMpz00T33GiwtJPDiy07s6Dz4oakTHcGxAdQkzjZRFKLg2QmWGALSS7obH+qLZeW0 RDFbuKeMZs0EU2uV3t+cdzlyQ+/HCFQBe7vcT46s6z2uC6sKlID9shHx0FjUua4YPD0i TLMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683618; x=1733288418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fOMvIhnFfNNITK55K9hXMMZ1nzXDoeNI+ouhBSMnChs=; b=KixrNGS09IoIb9ARa43jLESGhPp8sWBJadv3NYypa9PsT2/1/cQ+jj2H80m5Z6KtzA OhPSBXw9WQAVJ/y/wSqccD8VpMxYSHJ8BJnPS8SlZKnyzElSfpFsgSwiYWoScViq6LbB Zn7pt9ea9XdO/5e92UUkwqvk0TOuU5FBfC/ad9JrdBz0dgFIk+G4rbIVmQ9X/0yIayA2 zjcOM+wDSpIQvHLWGOuykobe+fy+67uwCWLnLgmSrj8W06nOL+S5BjP1THdHx5ZK27H/ b4Z0txx43XPflEvOe4KeAPtf9zt/MKcDuRrA5Mb9LsdyvaNhgI7hAwvigqtW7e3g2prB tkDQ== X-Gm-Message-State: AOJu0YwFeqwvRy6vjP9Bfsys1J4UH3VolhxYg2N12VE4wQeeDlMftMBh 4Ntb0vimgk5dksgH8yuhzIwIrdhdjL0hd7GvG1fzfuJkheGwCpYvSiwrTp9IXagDdCyhcksK/Cp T X-Gm-Gg: ASbGnctc33WqKGyKpDs4puChPRCvQgEUuXasK981+AikY7rNGxt7LDVEqCwSlS/Q9+3 0t/3EQ8bykS8HLz5kzlmO4XFQxnV0EgKZYrvaFX5ltlRhPGA7AyDoA0o+5y9tLo5mlI3qzK2QXg KeBzQTvFCor06sFHdWdY88noUb/ucS+Nj7q1I9SJeNoFMQWQP5KpZnRHbG8Q2/Ucc2tXzbwXa9W kR3FR9V8bphaJII3SSWeWJpiQxwcZ8IjwF3d0U/QqN7BUh0499x6q4qpUpYaOGU+P4Qo76Q0c85 bdddTacbQnI1Qg== X-Google-Smtp-Source: AGHT+IFxBfMXCkJiWp+4WcdL3TJWHcV3hlfd9nyavM96Dz957l8wQ4yy/wLpZeWIHZW2SyFTQHNunA== X-Received: by 2002:a17:902:cf0e:b0:212:67ca:3b10 with SMTP id d9443c01a7336-21501099d40mr22565695ad.21.1732683617770; Tue, 26 Nov 2024 21:00:17 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129dba6782sm93237055ad.102.2024.11.26.21.00.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 21:00:17 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3x-00000003ZW3-4138 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3y-0000000FQgI-0QIi for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 35/40] xfs/076: fix broken mkfs filtering Date: Wed, 27 Nov 2024 15:52:05 +1100 Message-ID: <20241127045403.3665299-36-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner The test does not do what it says on the packet - the mkfs output is not actually passed to the mkfs filter, so it doesn't know what inode size mkfs actually used. Hence CHUNK_SIZE ends up being calculated as 0, and that means it enters an endless loop because offset never decreases. Fix it by adding the missing line continuation. Signed-off-by: Dave Chinner --- tests/xfs/076 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/076 b/tests/xfs/076 index e315a067c..2ea6459b0 100755 --- a/tests/xfs/076 +++ b/tests/xfs/076 @@ -68,7 +68,7 @@ _require_xfs_sparse_inodes # bitmap consuming all the free space in our small data device. unset SCRATCH_RTDEV -_scratch_mkfs "-d size=96m -m crc=1 -i sparse" | tee -a $seqres.full | +_scratch_mkfs "-d size=96m -m crc=1 -i sparse" | tee -a $seqres.full | \ _filter_mkfs > /dev/null 2> $tmp.mkfs . $tmp.mkfs # for isize From patchwork Wed Nov 27 04:52:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886560 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 415A84689 for ; Wed, 27 Nov 2024 04:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683546; cv=none; b=Mcq+mF7HXdi6s6Ft3GfT1Q3BaYlyhJUcXoOdFar9hpaLAc42bEFqrCCqZQHMMGUO7E2BTUd8gqS+WrfcCQJNsyuoet8le+6q4Ye3hV9RJ3xL9mbqQhQ+FOzGqTyzYpLLH7YN4oKUskhSvoZFUkhS3O1pld/kQG+wcUqntC2lnlk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683546; c=relaxed/simple; bh=Lf47K7f1VAUohwSPIEOalscdH2rf7ZBjq/1KB7c8lx0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EyxBxGBMtiJACV6u90kwlLOii6sV+wCFw/4Ci0n4CV7gQhL6vLeHjmSn1tAtoofL1fqdyHWHt+2e5MdHGT/mnDAyy7dg2vtnu/nJSZhg3bxlA9DtQCiXqX+CJWZTwWR6IOBfXGYWwzdE1Thvjlf0cTaYnaNOF28dUFv42/4HYp8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=KWIymzq3; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="KWIymzq3" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2ea752c0555so4899875a91.3 for ; Tue, 26 Nov 2024 20:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683544; x=1733288344; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=K8Q8a71rnoEldk5CY5VppAcViknYxiUY+jLbO3d56Wc=; b=KWIymzq3nUE7J6Mgjd+Xkk7/tOtDTUac/Q4A9b/FnD/8sJ/dwCQB5DvR0a1hXR3Ouk IrRF7O4u7tcTUzYIE9NiApvArrU/OMnIl7PDQm8/Se4ETuMXxn4YPgfTX5vB8Rxfo4mM VL0r8FQ8nsQsC9xeGchc7Uzz7k4KTdTPeCRE2OYA9MMksKJqdUNE5KlS8nYG42unqcWB mJYRethRZHr0BeW5YswXR3glApNLy7Y0of0oHmFyoCycOmpPk2/0yCTqeL4jrB+bkQXP DjqzBG3Ll1X9cO5R8mW6ZOWGv9Cxe901YXYhKJpaoTZWvMK/Z3KoNOkNAAWstm0BtuDE JoyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683544; x=1733288344; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K8Q8a71rnoEldk5CY5VppAcViknYxiUY+jLbO3d56Wc=; b=g/ZHG26lWUZDkWwzKs7aJUznSGN7wmSbSXyxd58NHRTsakmQeEhauvsvRasbhi1LNE e8jNjXDZ2h5sM0U4P9zT5hAt1hulo28ovMIV2ffHLM4lA/OVMFQUoruuXJxFErxly7LI UZDmxa4yFnUS8eYrZ+TwX1TCDD1YICRYJFVub0vGmagbFeL7rImuxRKE9Qt2rurlVcL9 ttiTtIgwkJpBzKqRPBUmcv2qMTu1COmAewmuxQzqGlivRlsiHUp14ELOzJ106VpOBh5X PIaX4H+A3norabWVbafA36qLeB1euv1uymxVGCzXcJB5i7dLKZ+xCtRLOUpUJuw2agv3 x/JQ== X-Gm-Message-State: AOJu0Yxpi9HcmcDFe44VvJOqFll0vxEA0lm0ci/6kCv71TskC1jXaBK6 4dM5kxDNut6iKh7eJ/o7RdZ++eaT103DIdUMGxjAtxYWCFcoPXLYtNv6TDN25hFLG2D5HnONVbZ T X-Gm-Gg: ASbGncst/V7izTPsKRQiagJkO8RL0rBJcQ5cFipzxSH5IALyot9wYFABbxz6QXSeWZI XWX7jzhdGoiDAU/0/WABKP3h3LjzWza0mOii5qCOpHbo94pNPLvMW/qWcDZ4+Q4q21vDMalpyUM 3bgQ2BfC5JuqkjgtEuJOvgBHDEmRLMXMlcqHQrWh/sGSBiYukf0b9eLjPxElxtQPOACtYP347nv Jhe/6ba1dblxYB3GqDu8CZw38DWJoDKn1AZc3MKsRc9kFMshvoOpAlrthR+n3BAAu6LoSIA8pqO 4lNOloZi+9s6pQ== X-Google-Smtp-Source: AGHT+IE6WSTffzwyMdhvMqunI5dgay38NYLBW2ZDCJQhFxnrsXsL3XQZkAK12Vk2V6AHVqHh3CKEUA== X-Received: by 2002:a17:90b:1bd2:b0:2ea:4150:3f82 with SMTP id 98e67ed59e1d1-2ee08ecd374mr2214981a91.22.1732683544625; Tue, 26 Nov 2024 20:59:04 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee0532460asm607920a91.1.2024.11.26.20.59.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:59:03 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3y-00000003ZW8-01G3 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3y-0000000FQgM-0YAO for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 36/40] fstests: capture some failures to seqres.full Date: Wed, 27 Nov 2024 15:52:06 +1100 Message-ID: <20241127045403.3665299-37-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Whilst trying to debug test failures, I found a few places where errors needed to be redirected to $seqres.full rather than /dev/null. This is a collection of all the conversions that haven't been captured by some other bug fix patch. Note that calling _check_filesystems() after removing the require_test/scratch files means it is a no-op, so I removed that call at the same time as capturing unmount failures after the test has failed. Signed-off-by: Dave Chinner --- check | 5 ++--- tests/generic/049 | 2 +- tests/generic/603 | 6 +++--- tests/xfs/495 | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/check b/check index 9222cd7e4..8131f4e2e 100755 --- a/check +++ b/check @@ -1004,14 +1004,13 @@ function run_section() if [ $sts -ne 0 ]; then _dump_err_cont "[failed, exit status $sts]" - _test_unmount 2> /dev/null - _scratch_unmount 2> /dev/null + _test_unmount 2>> $seqres.full + _scratch_unmount 2>> $seqres.full rm -f ${RESULT_DIR}/require_test* rm -f ${RESULT_DIR}/require_scratch* # Even though we failed, there may be something interesting in # dmesg which can help debugging. _check_dmesg - (_adjust_oom_score 250; _check_filesystems) tc_status="fail" else # The test apparently passed, so check for corruption diff --git a/tests/generic/049 b/tests/generic/049 index 94b5afe96..fcfbd48ec 100755 --- a/tests/generic/049 +++ b/tests/generic/049 @@ -56,7 +56,7 @@ i=1; while [ $i -lt 1000 ] do file=$SCRATCH_MNT/$i - $XFS_IO_PROG -f -c "pwrite -b 32k -S 0xff 0 32k" $file > /dev/null + $XFS_IO_PROG -f -c "pwrite -b 32k -S 0xff 0 32k" $file >> $seqres.full if [ $? -ne 0 ] then echo error creating/writing file $file diff --git a/tests/generic/603 b/tests/generic/603 index a84695831..2a75cf9e0 100755 --- a/tests/generic/603 +++ b/tests/generic/603 @@ -77,7 +77,7 @@ test_grace() _filter_xfs_io_error | tee -a $seqres.full repquota -v -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Reset grace time here, make below grace time test more accurate - setquota -$type $qa_user -T $bgrace $igrace $SCRATCH_MNT 2>/dev/null + setquota -$type $qa_user -T $bgrace $igrace $SCRATCH_MNT >>$seqres.full 2>&1 # Now sleep enough grace time and check that softlimit got enforced sleep $((bgrace + 1)) echo "Try to write 1 one more block after grace..." @@ -89,13 +89,13 @@ test_grace() # And now the softlimit test for inodes # First reset space limits so that we don't have problems with # space reservations on XFS - setquota -$type $qa_user 0 0 3 100 $SCRATCH_MNT + setquota -$type $qa_user 0 0 3 100 $SCRATCH_MNT echo "Create 2 more files, over the inode softlimit..." su $qa_user -c "touch $dir/file3 $dir/file4" 2>&1 >>$seqres.full | \ _filter_scratch | tee -a $seqres.full repquota -v -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Reset grace time here, make below grace time test more accurate - setquota -$type $qa_user -T $bgrace $igrace $SCRATCH_MNT 2>/dev/null + setquota -$type $qa_user -T $bgrace $igrace $SCRATCH_MNT >>$seqres.full 2>&1 # Wait and check grace time enforcement sleep $((igrace+1)) echo "Try to create one more inode after grace..." diff --git a/tests/xfs/495 b/tests/xfs/495 index b42e7e5b3..ce724f381 100755 --- a/tests/xfs/495 +++ b/tests/xfs/495 @@ -24,7 +24,7 @@ _require_populate_commands _require_xfs_db_command "fuzz" echo "Format and populate" -_scratch_populate_cached nofill > $seqres.full 2>&1 +_scratch_populate_cached nofill >> $seqres.full 2>&1 filter_nbrepair() { grep rebuilding | sed -e 's/directory inode [0-9]*/directory inode XXX/g' From patchwork Wed Nov 27 04:52:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886552 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FCFC81AD7 for ; Wed, 27 Nov 2024 04:54:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683254; cv=none; b=T6DhkuNgcQQCVMU3S5qntgTkDGX3jVbHVVHNxaILIWrMZRgbLG7N62lR7Iv8O7ZpOCd+cMYLXWeTvJof8ogGMXKNu28gM33OxmXCXmg4ffXSmkvGPHRxNK55O46VArLJxxrRs0oWNqbWNf66Cgo0HsY7Q3QjSUWx4v4crwls3FI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683254; c=relaxed/simple; bh=4HUhmOuklofF3hdxIssO0B3uY7NHx2eK4y8TWUpNwpA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OZbbGwk+Te/hxiyqMyeuI7vQaeISCS6y6he7tQHomC3BSs7J5NyxyiCXbbqPqOBQkqz2sO7fKNrfoB59vhBwG26A3KS81tUO6cduTvjZVwvY6QqXTefBXzmKg5Z3wzljyGlWAipADRyBNG0OXCmZGtNe7kgwFcKmXXIblDImxH0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=wNolsrST; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="wNolsrST" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-724fee568aaso3455670b3a.1 for ; Tue, 26 Nov 2024 20:54:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683251; x=1733288051; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FelxBb4HuL38hiN4TbafKM7UoqDyP2KHet7HbJIXe48=; b=wNolsrST0bpR3o1TrfscCSn4+KGputR2VI9DFOGioubD+kD85lfvLYgvM5ZlJPRwIl 54BpR48vr/K/5WGOrCCzOW5Yiju3b2vllILd0MWCepagTx4lDgAH91GLc4UbD12o8Jdp aVqQEdLO2DAlviJO1QLVD/Z4vhNULfL3SBSwUUT28J2T0KDSo5bwF6yAM/T6NYOrElXy osYTAsMu3JNFJPVoT/0RiZpPKYctfs2FJMB7KpZFZznVOdvnxyhw7sf/d5i4P0O9bHtk pyj3nUrkm9PdbZxdTDh54nxkI4y3N+0pcpxoo/CCwcU0grCZroVJkTlMHrBabSN/3EUz 0sAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683251; x=1733288051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FelxBb4HuL38hiN4TbafKM7UoqDyP2KHet7HbJIXe48=; b=SoFB7Ar1cX6ZkzDABjtNxLxI9OXLSGlUFdbhr9MTDkpnjcz8myQMmZXstspb3EsGU9 koy6beMtJOuUb993toC/D9P4HXHwt5PFiUrub+kBk3Fz6PQlICbO6B2BqMsh2JJYFQif MdBHq5yg6EpV9qSkNYttdnaxbHFXlVy4sEpABd+Rb8khNhwfK8v7lxvj88FSgbg0yjkU R6tpSaeW/tWanWS3fGjHY+7nweY+ukUs0Az2PITI8wfemPRA3DxFhuD99OQD/2X4QhTt fQFzUNu05K6EGbcYRLcapNHraIDDz/Sd2fgl73mTSh7U2nHf5E0UYe5914mv9c5TIc9u z/cQ== X-Gm-Message-State: AOJu0Yx5bMNZPA8FYP49JrtYH4FH9Hc3EhRya/maAH14UhHvTwTG/9iY v9pQtfQl5PMeYz2+dT5d+Ns+FHLiy4Qp93VzFkTvwOeWn4H3VszDYQQaEtFv5tVHi6ZMo1fwKxH 9 X-Gm-Gg: ASbGncsn8JuHaH3BMf24aQCxO2lbNDZkempvZvETUNKunCok+zsoWTYJYvkAldlnR8r FNkYU66bQv5fHMIkTpw56soFEAqtN3BDYWIljsGWheF1IrciOm81nvKjidcgPevx4XMbJ/Ey+z4 XJJt9KJalJOkGMr/wIjnbJbDXFtbjIDaBkdxBT6Y056fw19qGvqgtL2+Cet2cHWdQ1i2dXeA4KJ s3oLBrVLKFh8u0GhjmFoCe29+yFHZBsdflKalp0P+LTRT6PP7Z4MukkuOdte7g0i2CdCKtnxRQm jOOHHG3jMcE977a8WQgd9xy7 X-Google-Smtp-Source: AGHT+IHWdUYnSGA3hSbTYPBVuWXrtvX9aw3vGYLCa6SILYvSUl9/jQQxtZ+ZjNu9ezCXLG3hXEerSg== X-Received: by 2002:a05:6a00:181b:b0:71e:4655:59ce with SMTP id d2e1a72fcca58-7252fe113f6mr2430067b3a.0.1732683250785; Tue, 26 Nov 2024 20:54:10 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72506288250sm5694766b3a.20.2024.11.26.20.54.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:54:09 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3y-00000003ZWB-05cq for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3y-0000000FQgR-0fzr for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 37/40] fstests: always use fail-at-unmount semantics for XFS Date: Wed, 27 Nov 2024 15:52:07 +1100 Message-ID: <20241127045403.3665299-38-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Rather than require every test that tests unmount in failure conditions have to set up fail-at-unmount semantics for the underlying filesystem, use these semantics for all test and scratch device mounts. This currently only affects XFS filesystems, and helps prevent unexpected unmount hangs in EIO tests because metadata writes are configured to try forever by default. Signed-off-by: Dave Chinner --- common/rc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/rc b/common/rc index 3b4b9a59f..7f4a71bd3 100644 --- a/common/rc +++ b/common/rc @@ -410,6 +410,7 @@ _try_scratch_mount() mount_ret=$? [ $mount_ret -ne 0 ] && return $mount_ret _idmapped_mount $SCRATCH_DEV $SCRATCH_MNT + _prepare_for_eio_shutdown $SCRATCH_DEV } # mount scratch device with given options and _fail if mount fails @@ -609,6 +610,7 @@ _test_mount() mount_ret=$? [ $mount_ret -ne 0 ] && return $mount_ret _idmapped_mount $TEST_DEV $TEST_DIR + _prepare_for_eio_shutdown $TEST_DEV } _test_unmount() From patchwork Wed Nov 27 04:52:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886559 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91DB04689 for ; Wed, 27 Nov 2024 04:59:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683541; cv=none; b=qZ496eoT4QJzI1PPBAMrwwGDNjm1M2fZiTGeMxbapWsmp63Nef9INy4hFLC0Esmek9Od4gEhesqxRS+5X8M+TjG1Vr5U32rk3dqLUT5fYOpTDw2gIhySzwPWjzbuONZ1ntXk4zCWTfB57vKhCJgBgsSHk3hTEI5dtWjB1PE47wA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683541; c=relaxed/simple; bh=oJAaDjS5ffMmwAPg4C4l3WNAY+wVknRcr2IA59Fa64c=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QOt49D3pgpK/1xO0W8kdRndeiiEEHts2Sk0vLnIA+cShIQgRQsppwwuq1S3NEQqFgEKx8gbTuGHPXzRS5e37N1ed72wdB+KGXAz0fJ/WTyPEoI5CW4SlMwnxvUMZqkQaQ2X113bQ7oggOq6Zx0RTVoFF8qSgSAz3EuBOCW26BnQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=MPOEBSCb; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="MPOEBSCb" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-7252b7326f4so1014243b3a.2 for ; Tue, 26 Nov 2024 20:59:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683540; x=1733288340; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8hTOuI7jzPuJR5iLCMuKxkGY4seL8nFZpcu2nArCUfY=; b=MPOEBSCbaydLdIypPwsnzl5tb3UongwGAyk5Wfu4Tk8nXbMTY167GPXi8ce9JI7mek IiBQ6nVn/GRwuVKAQ4V/vREccdyl+/mhd3tTlSjfnZF/3o1c8noBfsDMb8r7NCEVFGuP bWTK7+93aRQ/OyNTW+hfEhRrHx8PkiySGn9ZIfxgFXpNsc7SqAGVpToOUi/aRS4kZM3l m+fGaYbczcDw/BOx535pbuSQC34jAvvGWteAOkd7UY9lBLwIqstAH7odCgvJAEFOFj2q t4yIS6xnLNx+bdeIdTzvBeUVYsVjr8JoEPzag2EOcYbPf3zjnoTSTbHcBjCK17HesNDM FM0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683540; x=1733288340; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8hTOuI7jzPuJR5iLCMuKxkGY4seL8nFZpcu2nArCUfY=; b=Zjhd5G1qaoXHPz4+mY2mUUb4icKUN2zHhENvLOufSUjvUbOTYN272vCCxksBkI7gE3 9rwfl5wa2wKaxUPXaFPtQtXTdW47DN+N57yo9J9fXoYXvbwjCwodjJME3ydmBBvng1SZ XWma6RSfqm+d2iY+hB9CIR+OtMlGlvCSMxlexGl5GfRXvYjuWcxkgsLyAo293cK1tZ4J ouBu1CBQUy/3L++Pk8boyemAUtsdXp3gz6k4dB/JpHOY+7ZVgx6lwh+BcdxdsHZz7lLH fb5usy95vEFUgiDjo0vRpXySLdfja5E9NMhW13XtMalsTS2QFCkUm9nYEQlNpLbjcLAD YetQ== X-Gm-Message-State: AOJu0YxWMJnAMhQ7fCY8VTx5G9FCG7i0YArVHXjoWRMEGu+Tlb0oTGZ9 rx2Lk8KX6XM0zC5sN1nobBztX217/S0rsWJDSXA2gKsZZhkI9gvVkCPLR/vU9bhSMO0RHF4h5sT x X-Gm-Gg: ASbGnctJiFyQFBSoyNBbhoRSDBhT2Eix6n2T25qDBBywkM3Z+ou1/SQO+fc7ZBmj7WV CSGyqNDss9CagJFQ4yD/Lrt3M57/gHPZ90YmzsCEAXOxi5FyuRP/EUTKjdcVmFa2NLKLcNHapgh QaheBBHSECbduwLAeQkAWOJEGpxVZr5aKrhxiHVnTrOM7dd4B3TAaOJ/r0e5GTWYZp4Pbfj7nO5 K9hwuTCg0UhMU0PB+NDhisIe9K+OIXw+1R7Qnz4hpob0f9v18Mi7I4OB9RJeEV6hyMi5HljKWs7 AQfsnYErXFAMfA== X-Google-Smtp-Source: AGHT+IGtPhKRYPvHYgP8dlRT/FdgMYlF5plhlXpdTn0nPPkEjMRjcMcL++JGWJm2d51KG7mi0PNu0g== X-Received: by 2002:a05:6a21:3288:b0:1d2:eb91:c0c1 with SMTP id adf61e73a8af0-1e0e0b8d197mr2931887637.42.1732683540000; Tue, 26 Nov 2024 20:59:00 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ee0fb10f74sm493080a91.48.2024.11.26.20.58.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:58:59 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3y-00000003ZWG-0DyG for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3y-0000000FQgV-0oCz for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 38/40] generic/062: don't leave debug files in $here on failure Date: Wed, 27 Nov 2024 15:52:08 +1100 Message-ID: <20241127045403.3665299-39-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Move them to $seqres. so they don't pollute the source tree that fstests is running from. Signed-off-by: Dave Chinner --- tests/generic/062 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/generic/062 b/tests/generic/062 index f0904992d..896590403 100755 --- a/tests/generic/062 +++ b/tests/generic/062 @@ -196,7 +196,7 @@ echo "*** compare before and after backups" diff $tmp.backup1 $tmp.backup2 if [ $? -ne 0 ]; then echo "urk, failed - creating $seq.backup1 and $seq.backup2" - cp $tmp.backup1 $seq.backup1 && cp $tmp.backup2 $seq.backup2 + cp $tmp.backup1 $seqres.backup1 && cp $tmp.backup2 $seqres.backup2 status=1 exit fi From patchwork Wed Nov 27 04:52:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886558 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 747B84689 for ; Wed, 27 Nov 2024 04:58:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683538; cv=none; b=Vu0lyujb5oZk3f1F7A7GRIS6cmDPHu3EWg0btEseEnY81qY6dkjtw7oboE5DIOPwG7UZdBFq6HRjtr/oO8U6ogNAdszA0yJzk5TxZVxs9/j0QR/DUCMyFZviOnq4APFqUgGEt8wujaV63/K3eGdcwcbtOy7j/LzlpXuloWQWs1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683538; c=relaxed/simple; bh=q8k5vx+XGCEGi5YKN9SgztsduoIXgCC5hO6g0BFSyc0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pOoEj76ofjh7QiudNfnAP1HXD4Lf0F0Vh99mo3qp7vjgJXYpv7llz5hBHFSSMII2iD1jep+sc7mE/8JBtU51tVfs87JSD51g4dzmJjMK5kKFOOvgLtNN0k+e0lPwcRUQk73co65llhT0JJ/U6XCkyVl6woH4GNBuACMtJ3ZCAL0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=xbN3lN+a; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="xbN3lN+a" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-211fcadd960so43172045ad.2 for ; Tue, 26 Nov 2024 20:58:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683537; x=1733288337; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=5MeguoAYsRnRZ+x/PYPsW6nmhHR/r9v76Psdl4kuDkg=; b=xbN3lN+aeGF6m2kMQ4HbDr9IlIcUumdq+U6FozSt7+k86GcbgkJs0q/7I3YrrblvyB T4zjnHijU13w4SXM3fKyIZXoHk7FQCdS5XVL/03XdKmddLBMIbBO6hpNtzRQ49cat7B+ FG0ARyjaTYSiSPY6mtMxb8c4xXesMjp9H0LwK2i/Ole0s9TsAG04w3kBpgCqAUyBilI8 kxMhzDaKmz02sncKzN0lLspVaOipILbDorrBNxPDxyJ6xvtmFBx+8qCfyTmg9nrTcWe+ yIHLgPozv1EcufG8huh8AmeKVtqi+J6ST36iKOKzmYlzjwywcS5jLh1hZubIDp//29pi 1lrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683537; x=1733288337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5MeguoAYsRnRZ+x/PYPsW6nmhHR/r9v76Psdl4kuDkg=; b=fgppa1VTykvzy/hiPKQYZ5rJBxS7pt1fQCr5dpsGqsqzC416wxluRHUjKhki4JRRRo WebcsDucqRBiYwKp28KLZtjVj/wegUgHimQBooyks0WxEEk1xmFIcjDJtRwQXvbuHIje RQm0KLp8N9LVjXM0YExl9lQutl3lJ1BdnFfAux1ptf14mmtwajQJmuNIiR9QGQKLch+z fa10f8ki4vCaT09Gf/VqHmGx3b0EiHca9AYBQNsS3j6MYjuIQgkUEXxr8Lb8sSu/avQe FRvEgaGmpQplTjbX0kBzFP9n4+wiD/fwZv3uPmtPZbpyYiqhGE/D1wWazn8VYohCHzKx qOKQ== X-Gm-Message-State: AOJu0Yzqhm8mUtdOXhcX6JCm1B5pu778q1EZF3HzZ65C7CrL/SZ8jcb6 hxqls8Xui8rW9NY3k1Bf9l3vCS0zi7WNoOhkLgGlhwJ4Vy+zTLEbRpOU6yoXPvZldMfZZyZpzaH 3 X-Gm-Gg: ASbGncurxPFEzgdX4V8056acbBcZTpT8DXUxETmBVR8wUv9DJZGUEtFXLNi4Z1X5xAl Ef5dHfOfBquMDqD1ozXL9lXEsudBGXMYuJVRYPwKX9mn+H9aV/fnZaschQxjnhtz+KjnrT0DZvg lUsbpftoUBNEybj3eJQKJiDr26cu9ENg4e9UGk+NVRU69+X7mjEMJxhjhIPu7gAMsSZP/IEvPwu 71M0SuBESH9fueO/yeqgmrr5Tn2g+ueWq/jQrYwvSCpIepruqsU5tRt91Us4dvD1TtZuFH1XQQ7 la7XcmHUJ/87aQ== X-Google-Smtp-Source: AGHT+IHdBi/8Y97OpiUvVUM89W+kBuIsfpyeAeIYWiefHUSn/pCHB+++oM7O9HQA/DHEXJpOnQnwSA== X-Received: by 2002:a17:902:f70b:b0:20e:71ee:568e with SMTP id d9443c01a7336-2150128c578mr25557305ad.13.1732683536799; Tue, 26 Nov 2024 20:58:56 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2129db8c7aesm93335695ad.55.2024.11.26.20.58.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:58:56 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3y-00000003ZWL-0NhD for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3y-0000000FQgb-0xLQ for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 39/40] fstests: quota grace periods unreliable under load Date: Wed, 27 Nov 2024 15:52:09 +1100 Message-ID: <20241127045403.3665299-40-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Starting the quota grace period doesn't necessary happen predictably when the system is under heavy load. This results in random test failures where grace period timeouts are expected. Signed-off-by: Dave Chinner --- tests/generic/601 | 7 ++++--- tests/xfs/050 | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/generic/601 b/tests/generic/601 index 9860505ba..78b6a4aaa 100755 --- a/tests/generic/601 +++ b/tests/generic/601 @@ -52,9 +52,10 @@ $XFS_QUOTA_PROG -x -c "timer -u -i 100 $qa_user" $SCRATCH_MNT # raw ("since epoch") grace expiry get=`repquota -up $SCRATCH_MNT | grep "^$qa_user" | awk '{print $NF}'` -# Either the new expiry must match; or be one second after the set time, to -# deal with the seconds counter incrementing. -if [ "$get" != "$set" ] && [ "$get" -ne "$((set + 1))" ]; then +# Either the new expiry must match or be soon after the set time as there +# may be load related delays on setting the new timer. A 10s "grace" window +# should be enough for everyone. +if [ "$get" != "$set" ] && [ "$get" -gt "$((set + 10))" ]; then echo "set grace to $set but got grace $get" fi diff --git a/tests/xfs/050 b/tests/xfs/050 index 7baaaeaa3..78303bf78 100755 --- a/tests/xfs/050 +++ b/tests/xfs/050 @@ -115,6 +115,11 @@ _exercise() echo echo "*** push past the soft block limit" | tee -a $seqres.full _file_as_id $SCRATCH_MNT/softie $id $type $bsize 300 + + # sync so that the data is actually allocated as soft limit timers + # are not started until block allocation is done. This means the test + # will work even if remount sliently fails due to busy mounts + _scratch_sync _qmount $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \ -c "repquota -birnN -$type" $SCRATCH_DEV | From patchwork Wed Nov 27 04:52:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13886557 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E66864689 for ; Wed, 27 Nov 2024 04:58:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683535; cv=none; b=mNvRoPvjMKvfCypiAqoHpwobB1R8OyEkbh7NvGchQBQAh02H6C6JPOjCZbVXWItTuisyjs0FZz1s0dpRPVWfuUjdS4HoMVH60Q/b6J4XJ4sVotBGzJj/4ydCbTYVtamGuX8/4LJ+EBJqikQlmsiBnYsGGwCO8YfV1r3ptKrjjyU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732683535; c=relaxed/simple; bh=89bFUxX41Wygscy97EW5vtGNO+ZC/d4tCi45n21ktKQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YYdnqTkc7Yq/N5qkgvyr8DXZpcw1+cH/OboE6XOEayCeefvyHYRIlSNHtdRrPk34jLRRtmpmZxJJ2MivA/ELGG5peagOuSC3KbEOUMHCq7NupcJ23NADjGO9dIG/HmmzB9kGLfoEZcZgXDKEJ+maVleyebcxPUYcedHExQYoyq8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com; spf=pass smtp.mailfrom=fromorbit.com; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b=m8GThCmd; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fromorbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fromorbit-com.20230601.gappssmtp.com header.i=@fromorbit-com.20230601.gappssmtp.com header.b="m8GThCmd" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-211fd6a0a9cso46491905ad.3 for ; Tue, 26 Nov 2024 20:58:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1732683533; x=1733288333; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=tlQ35L+7JZAQDVtnnWfihYDXlIAcyIpwmQwcp2xjHxA=; b=m8GThCmdcvN+JubLaqC2H85V3Tfx6yNuHHJIv8i4Ef2ZinTucY4aoJDaJoVCVCpnFY crfiOSA9LVGyv2cwjA9kr4U4hJgvkUfDc/dt5Iu4RFg0cFkcJS1MO3ippuy1Gevj51lu v4HY4GhbdeCvcSPXaArvDImp6rM8XDSePrbghr8DGW/MVAQOa5Tq8OET+fpwZcKyPQwD IZM6uQATo4KtKtBUj7jm8MMs84FKuv3FnKV1UJk/9UTVP8sKuxVU65ef9CxaHjY6dDbp akK9XuEoCznQNT6E4/a06to72VxzvrKutAN9BX0SjUhOa98r6SHhavaB0CwFIjc8C6+l 1Vpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732683533; x=1733288333; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tlQ35L+7JZAQDVtnnWfihYDXlIAcyIpwmQwcp2xjHxA=; b=U83FjLjOBqze+71v+6tcvRYO8oVKLmPOXlYoroYhO46xBo4R9e3tIZD3qdJqheIrp/ bT0RDwdPTDWyGqIgAKcnXMlQwHRFGla4HxEBgQzijxIbVfcQi4H2HkgLyWWsYYKy/7aQ QpjhSWbCMqyjmqCuG4x38YFSUB9WBJAUKuSno+WcoFq+cCOpHZ09EejEKbhTMFBAfgX6 raaVT3fZ5oq8x48dFam2ZjPI8SGgDAFGqQKw4RHCzaUUgfBeCxmhsgrasqkagOQZDiHe lvt/YIM+8UClKydrkvastjgJhKn6k5Kvy55gOnSvBeRI1iOdeNSUxqZnyjnZTKmmtnnm C9MA== X-Gm-Message-State: AOJu0Yw5OoWhaFpqK+BfKpGajSJBkRUn7c1ppAUCx7oU/7mBg4+zDFd8 IywGDgFv77cqO3KEcrRPt8LUo+ShHcqpDXHTXpNpk4FE3khj1TMmsKzrx/RJvYbjKmAU+TBc3wC V X-Gm-Gg: ASbGncs1mn6tjeGQC/i5J8GETIbCS6D7NlZwOM4M46vsh+WfiukfK4SmRIPDzTWeiKT aIPY3A3ceJtp3wN0jkS9VJ1tgRpwB3PM6gvlH5P6goAn/VI9GvILov6YT+lYAucnS0qV9Ll+WzM tdBqfNNbFCUdSuyh3caZjHOydpPndjkMj8cAkbzLzhc2zefeaLh+pOEY0e4lsvyIE4T1qtDYl8L EwHUez3HrBya1ui69I9005WbAa551Pxc3Q+IVj7CzFLMGHwa6GBnp77kcPp+PuTh3G/R7PYkCuT rgzfCpIP6do0WoUNUwPkLrSn X-Google-Smtp-Source: AGHT+IHMt7uAJO012FXYhT3FnDk5zw/4DH4aRoIcWdLeFrup1Ar9Jv+7Kt2mU7IQDCCcMPz3+6yP+A== X-Received: by 2002:a17:902:ecce:b0:20d:2804:bcde with SMTP id d9443c01a7336-21501e5c83emr23094095ad.35.1732683533034; Tue, 26 Nov 2024 20:58:53 -0800 (PST) Received: from dread.disaster.area (pa49-180-121-96.pa.nsw.optusnet.com.au. [49.180.121.96]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-214f87bc298sm12633165ad.226.2024.11.26.20.58.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 20:58:52 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.98) (envelope-from ) id 1tGA3y-00000003ZWP-0XM4 for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.98) (envelope-from ) id 1tGA3y-0000000FQgh-17fu for fstests@vger.kernel.org; Wed, 27 Nov 2024 15:54:06 +1100 From: Dave Chinner To: fstests@vger.kernel.org Subject: [PATCH 40/40] fstests: check-parallel Date: Wed, 27 Nov 2024 15:52:10 +1100 Message-ID: <20241127045403.3665299-41-david@fromorbit.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241127045403.3665299-1-david@fromorbit.com> References: <20241127045403.3665299-1-david@fromorbit.com> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Dave Chinner Runs tests in parallel runner threads. Each runner thread has it's own set of tests to run, and runs a separate instance of check to run those tests. check-parallel sets up loop devices, mount points, results directories, etc for each instance and divides the tests up between the runner threads. It currently hard codes the XFS and generic test lists, and then gives each check invocation an explicit list of tests to run. It also passes through exclusions so that test exclude filtering is still done by check. This is far from ideal, but I didn't want to have to embark on a major refactoring of check to be able to run stuff in parallel. It was quite the challenge just to get all the tests and test infrastructure up to the point where they can run reliably in parallel. Hence I've left the actual factoring of test selection and setup out of the patchset for the moment. The plan is to factor both the test setup and the test list runner loop out of check and share them between check and check-parallel, hence not requiring check-parallel to run check directly. That is future work, however. With the current test runner setup, it is not uncommon to see >5000% cpu usage, 150-200kiops and 4-5GB/s of disk bandwidth being used when running 64 runners. This is a serious stress load as it is constantly mounting and unmounting dozens of filesystems, creating and destroying devices, dropping caches, running sync, running CPU hot plug, running page cache migration, etc. The massive amount of IO that load generates causes qemu hosts to abort (i.e. crash) because they run out of vm map segments. Hence bumping up the max_map_count on the host like so: echo 1048576 > /proc/sys/vm/max_map_count is necessary. There is no significant memory pressure to speak of from running the tests like this. I've seen a maximum of about 50GB of RAM used when running tests like this, so running on a 64p/64GB VM the additional concurrency doesn't really stress memory capacity like it does CPU and IO. All the runners are executed in private mount namespaces. This is to prevent ephemeral mount namespace clones from taking a reference to every mounted filesystem in the machine and so causing random "device busy after unmount" failures in the tests that are running concurrently with the mount namespace setup and teardown. A typical `pstree -N mnt` looks like: $ pstree -N mnt [4026531841] bash bash───pstree [0] sudo───sudo───check-parallel─┬─check-parallel───nsexec───check───311─┬─cut │ └─md5sum ├─check-parallel───nsexec───check───750─┬─750───sleep │ └─750.fsstress───4*[750.fsstress───{750.fsstress}] ├─check-parallel───nsexec───check───013───013───sed ├─check-parallel───nsexec───check───251───cp ├─check-parallel───nsexec───check───467───open_by_handle ├─check-parallel───nsexec───check───650─┬─650───sleep │ └─650.fsstress─┬─61*[650.fsstress───{650.fsstress}] │ └─2*[650.fsstress] ├─check-parallel───nsexec───check───707 ├─check-parallel───nsexec───check───705 ├─check-parallel───nsexec───check───416 ├─check-parallel───nsexec───check───477───2*[open_by_handle] ├─check-parallel───nsexec───check───140───140 ├─check-parallel───nsexec───check───562 ├─check-parallel───nsexec───check───415───xfs_io───{xfs_io} ├─check-parallel───nsexec───check───291 ├─check-parallel───nsexec───check───017 ├─check-parallel───nsexec───check───016 ├─check-parallel───nsexec───check───168───2*[168───168] ├─check-parallel───nsexec───check───672───2*[672───672] ├─check-parallel───nsexec───check───170─┬─170───170───170 │ └─170───170 ├─check-parallel───nsexec───check───531───122*[t_open_tmpfiles] ├─check-parallel───nsexec───check───387 ├─check-parallel───nsexec───check───748 ├─check-parallel───nsexec───check───388─┬─388.fsstress───4*[388.fsstress───{388.fsstress}] │ └─sleep ├─check-parallel───nsexec───check───328───328 ├─check-parallel───nsexec───check───352 ├─check-parallel───nsexec───check───042 ├─check-parallel───nsexec───check───426───open_by_handle ├─check-parallel───nsexec───check───756───2*[open_by_handle] ├─check-parallel───nsexec───check───227 ├─check-parallel───nsexec───check───208───aio-dio-invalid───2*[aio-dio-invalid] ├─check-parallel───nsexec───check───746───cp ├─check-parallel───nsexec───check───187───187 ├─check-parallel───nsexec───check───027───8*[027] ├─check-parallel───nsexec───check───045───xfs_io───{xfs_io} ├─check-parallel───nsexec───check───044 ├─check-parallel───nsexec───check───204 ├─check-parallel───nsexec───check───186───186 ├─check-parallel───nsexec───check───449 ├─check-parallel───nsexec───check───231───su───fsx ├─check-parallel───nsexec───check───509 ├─check-parallel───nsexec───check───127───5*[127───fsx] ├─check-parallel───nsexec───check───047 ├─check-parallel───nsexec───check───043 ├─check-parallel───nsexec───check───475───pkill ├─check-parallel───nsexec───check───299─┬─fio─┬─4*[fio] │ │ ├─2*[fio───4*[{fio}]] │ │ └─{fio} │ └─pgrep ├─check-parallel───nsexec───check───551───aio-dio-write-v ├─check-parallel───nsexec───check───323───aio-last-ref-he───100*[{aio-last-ref-he}] ├─check-parallel───nsexec───check───648───sleep ├─check-parallel───nsexec───check───046 ├─check-parallel───nsexec───check───753─┬─753.fsstress───4*[753.fsstress] │ └─pkill ├─check-parallel───nsexec───check───507───507 ├─check-parallel───nsexec───check───629─┬─3*[629───xfs_io───{xfs_io}] │ └─5*[629] ├─check-parallel───nsexec───check───073───umount ├─check-parallel───nsexec───check───615───615 ├─check-parallel───nsexec───check───176───punch-alternati ├─check-parallel───nsexec───check───294 ├─check-parallel───nsexec───check───236───236 ├─check-parallel───nsexec───check───165─┬─165─┬─165─┬─cut │ │ │ └─xfs_io───{xfs_io} │ │ └─165───grep │ └─165 ├─check-parallel───nsexec───check───259───sync ├─check-parallel───nsexec───check───442───442.fsstress───4*[442.fsstress───{442.fsstress}] ├─check-parallel───nsexec───check───558───255*[558] ├─check-parallel───nsexec───check───358───358───358 ├─check-parallel───nsexec───check───169───169 └─check-parallel───nsexec───check───297─┬─297.fsstress─┬─284*[297.fsstress───{297.fsstress}] │ └─716*[297.fsstress] └─sleep A typical test run looks like: $ time sudo ./check-parallel /mnt/xfs -s xfs -x dump Runner 63 Failures: xfs/170 Runner 36 Failures: xfs/050 Runner 30 Failures: xfs/273 Runner 29 Failures: generic/135 Runner 25 Failures: generic/603 Tests run: 1140 Failure count: 5 Ten slowest tests - runtime in seconds: xfs/013 454 generic/707 414 generic/017 398 generic/387 395 generic/748 390 xfs/140 351 generic/562 351 generic/705 347 generic/251 344 xfs/016 343 Cleanup on Aisle 5? total 0 crw-------. 1 root root 10, 236 Nov 27 09:27 control lrwxrwxrwx. 1 root root 7 Nov 27 09:27 fast -> ../dm-0 /dev/mapper/fast 1.4T 192G 1.2T 14% /mnt/xfs real 9m29.056s user 0m0.005s sys 0m0.022s $ Yeah, that runtime is real - under 10 minutes for a full XFS auto group test run. When running this normally (i.e. via check) on this machine, it usually takes just under 4 hours to run the same set of tests. i.e. I can run ./check-parallel roughly 25x times on this machine in the same time it takes to run ./check. Signed-off-by: Dave Chinner --- check | 7 +- check-parallel | 205 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+), 4 deletions(-) create mode 100755 check-parallel diff --git a/check b/check index 8131f4e2e..607d2456e 100755 --- a/check +++ b/check @@ -33,7 +33,7 @@ exclude_tests=() _err_msg="" # start the initialisation work now -iam=check +iam=check.$$ # mkfs.xfs uses the presence of both of these variables to enable formerly # supported tiny filesystem configurations that fstests use for fuzz testing @@ -460,7 +460,7 @@ fi _wrapup() { - seq="check" + seq="check.$$" check="$RESULT_BASE/check" $interrupt && sect_stop=`_wallclock` @@ -552,7 +552,6 @@ _wrapup() sum_bad=`expr $sum_bad + ${#bad[*]}` _wipe_counters - rm -f /tmp/*.rawout /tmp/*.out /tmp/*.err /tmp/*.time if ! $OPTIONS_HAVE_SECTIONS; then rm -f $tmp.* fi @@ -808,7 +807,7 @@ function run_section() init_rc - seq="check" + seq="check.$$" check="$RESULT_BASE/check" # don't leave old full output behind on a clean run diff --git a/check-parallel b/check-parallel new file mode 100755 index 000000000..c85437252 --- /dev/null +++ b/check-parallel @@ -0,0 +1,205 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Red Hat, Inc. All Rights Reserved. +# +# Run all tests in parallel +# +# This is a massive resource bomb script. For every test, it creates a +# pair of sparse loop devices for test and scratch devices, then mount points +# for them and runs the test in the background. When it completes, it tears down +# the loop devices. + +export SRC_DIR="tests" +basedir=$1 +shift +check_args="$*" +runners=64 +runner_list=() +runtimes=() + + +# tests in auto group +test_list=$(awk '/^[0-9].*auto/ { print "generic/" $1 }' tests/generic/group.list) +test_list+=$(awk '/^[0-9].*auto/ { print "xfs/" $1 }' tests/xfs/group.list) + +# grab all previously run tests and order them from highest runtime to lowest +# We are going to try to run the longer tests first, hopefully so we can avoid +# massive thundering herds trying to run lots of really short tests in parallel +# right off the bat. This will also tend to vary the order of tests from run to +# run somewhat. +# +# If we have tests in the test list that don't have runtimes recorded, then +# append them to be run last. + +build_runner_list() +{ + local runtimes + local run_list=() + local prev_results=`ls -tr $basedir/runner-0/ | grep results | tail -1` + + runtimes=$(cat $basedir/*/$prev_results/check.time | sort -k 2 -nr | cut -d " " -f 1) + + # Iterate the timed list first. For every timed list entry that + # is found in the test_list, add it to the local runner list. + local -a _list=( $runtimes ) + local -a _tlist=( $test_list ) + local rx=0 + local ix + local jx + #set -x + for ((ix = 0; ix < ${#_list[*]}; ix++)); do + echo $test_list | grep -q ${_list[$ix]} + if [ $? == 0 ]; then + # add the test to the new run list and remove + # it from the remaining test list. + run_list[rx++]=${_list[$ix]} + _tlist=( ${_tlist[*]/${_list[$ix]}/} ) + fi + + done + + # The final test list is all the time ordered tests followed by + # all the tests we didn't find time records for. + test_list="${run_list[*]} ${_tlist[*]}" +} + +if [ -f $basedir/runner-0/results/check.time ]; then + build_runner_list +fi + +# split the list amongst N runners + +split_runner_list() +{ + local ix + local rx + local -a _list=( $test_list ) + for ((ix = 0; ix < ${#_list[*]}; ix++)); do + seq="${_list[$ix]}" + rx=$((ix % $runners)) + runner_list[$rx]+="${_list[$ix]} " + #echo $seq + done +} + +_create_loop_device() +{ + local file=$1 dev + + dev=`losetup -f --show $file` || _fail "Cannot assign $file to a loop device" + + # Using buffered IO for the loop devices seems to run quite a bit + # faster. There are a lot of tests that hit the same regions of the + # filesystems, so avoiding read IO seems to really help. Results can + # vary, though, because many tests drop all caches unconditionally. + # Uncomment to use AIO+DIO loop devices instead. + #test -b "$dev" && losetup --direct-io=on $dev 2> /dev/null + + echo $dev +} + +_destroy_loop_device() +{ + local dev=$1 + blockdev --flushbufs $dev + umount $dev > /dev/null 2>&1 + losetup -d $dev || _fail "Cannot destroy loop device $dev" +} + +runner_go() +{ + local id=$1 + local me=$basedir/runner-$id + local _test=$me/test.img + local _scratch=$me/scratch.img + local _results=$me/results-$2 + + mkdir -p $me + + xfs_io -f -c 'truncate 2g' $_test + xfs_io -f -c 'truncate 8g' $_scratch + + mkfs.xfs -f $_test > /dev/null 2>&1 + + export TEST_DEV=$(_create_loop_device $_test) + export TEST_DIR=$me/test + export SCRATCH_DEV=$(_create_loop_device $_scratch) + export SCRATCH_MNT=$me/scratch + export FSTYP=xfs + export RESULT_BASE=$_results + + mkdir -p $TEST_DIR + mkdir -p $SCRATCH_MNT + mkdir -p $RESULT_BASE + rm -f $RESULT_BASE/check.* + +# export DUMP_CORRUPT_FS=1 + + # Run the tests in it's own mount namespace, as per the comment below + # that precedes making the basedir a private mount. + ./src/nsexec -m ./check $check_args -x unreliable_in_parallel --exact-order ${runner_list[$id]} > $me/log 2>&1 + + wait + sleep 1 + umount -R $TEST_DIR 2> /dev/null + umount -R $SCRATCH_MNT 2> /dev/null + _destroy_loop_device $TEST_DEV + _destroy_loop_device $SCRATCH_DEV + + grep -q Failures: $me/log + if [ $? -eq 0 ]; then + echo -n "Runner $id Failures: " + grep Failures: $me/log | uniq | sed -e "s/^.*Failures://" + fi + +} + +cleanup() +{ + killall -INT -q check + wait + umount -R $basedir/*/test 2> /dev/null + umount -R $basedir/*/scratch 2> /dev/null + losetup --detach-all +} + +trap "cleanup; exit" HUP INT QUIT TERM + + +# Each parallel test runner needs to only see it's own mount points. If we +# leave the basedir as shared, then all tests see all mounts and then we get +# mount propagation issues cropping up. For example, cloning a new mount +# namespace will take a reference to all visible shared mounts and hold them +# while the mount names space is active. This can cause unmount in the test that +# controls the mount to succeed without actually unmounting the filesytsem +# because a mount namespace still holds a reference to it. This causes other +# operations on the block device to fail as it is still busy (e.g. fsck, mkfs, +# etc). Hence we make the basedir private here and then run each check instance +# in it's own mount namespace so that they cannot see mounts that other tests +# are performing. +mount --make-private $basedir +split_runner_list +now=`date +%Y-%m-%d-%H:%M:%S` +for ((i = 0; i < $runners; i++)); do + + runner_go $i $now & + +done; +wait + +echo -n "Tests run: " +grep Ran /mnt/xfs/*/log | sed -e 's,^.*:,,' -e 's, ,\n,g' | sort | uniq | wc -l + +echo -n "Failure count: " +grep Failures: $basedir/*/log | uniq | sed -e "s/^.*Failures://" -e "s,\([0-9]\) \([gx]\),\1\n \2,g" |wc -l +echo + +echo Ten slowest tests - runtime in seconds: +cat $basedir/*/results/check.time | sort -k 2 -nr | head -10 + +echo +echo Cleanup on Aisle 5? +echo +losetup --list +ls -l /dev/mapper +df -h |grep xfs