From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>
To: fstests@vger.kernel.org
Cc: linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org,
ritesh.list@gmail.com, ojaswin@linux.ibm.com, djwong@kernel.org,
zlang@kernel.org, david@fromorbit.com,
nirjhar.roy.lists@gmail.com
Subject: [PATCH v2 3/5] check,common{rc,preamble}: Decouple init_rc() call from sourcing common/rc
Date: Tue, 1 Apr 2025 06:43:58 +0000 [thread overview]
Message-ID: <ad86fdf39bfac1862960fb159bb2757e100db898.1743487913.git.nirjhar.roy.lists@gmail.com> (raw)
In-Reply-To: <cover.1743487913.git.nirjhar.roy.lists@gmail.com>
Silently executing scripts during sourcing common/rc isn't good practice
and also causes unnecessary script execution. Decouple init_rc() call
and call init_rc() explicitly where required.
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
---
check | 2 ++
common/preamble | 1 +
common/rc | 2 --
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/check b/check
index 16bf1586..2d2c82ac 100755
--- a/check
+++ b/check
@@ -364,6 +364,8 @@ if ! . ./common/rc; then
exit 1
fi
+init_rc
+
# If the test config specified a soak test duration, see if there are any
# unit suffixes that need converting to an integer seconds count.
if [ -n "$SOAK_DURATION" ]; then
diff --git a/common/preamble b/common/preamble
index 0c9ee2e0..c92e55bb 100644
--- a/common/preamble
+++ b/common/preamble
@@ -50,6 +50,7 @@ _begin_fstest()
_register_cleanup _cleanup
. ./common/rc
+ init_rc
# remove previous $seqres.full before test
rm -f $seqres.full $seqres.hints
diff --git a/common/rc b/common/rc
index 16d627e1..038c22f6 100644
--- a/common/rc
+++ b/common/rc
@@ -5817,8 +5817,6 @@ _require_program() {
_have_program "$1" || _notrun "$tag required"
}
-init_rc
-
################################################################################
# make sure this script returns success
/bin/true
--
2.34.1
next prev parent reply other threads:[~2025-04-01 6:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 6:43 [PATCH v2 0/5] Minor cleanups in common/ Nirjhar Roy (IBM)
2025-04-01 6:43 ` [PATCH v2 1/5] generic/749: Remove redundant sourcing of common/rc Nirjhar Roy (IBM)
2025-04-04 3:31 ` Ritesh Harjani
2025-04-01 6:43 ` [PATCH v2 2/5] check: Remove redundant _test_mount in check Nirjhar Roy (IBM)
2025-04-04 3:36 ` Ritesh Harjani
2025-04-08 5:41 ` Nirjhar Roy (IBM)
2025-04-08 5:45 ` Nirjhar Roy (IBM)
2025-04-01 6:43 ` Nirjhar Roy (IBM) [this message]
2025-04-04 4:00 ` [PATCH v2 3/5] check,common{rc,preamble}: Decouple init_rc() call from sourcing common/rc Ritesh Harjani
2025-04-04 4:52 ` Nirjhar Roy (IBM)
2025-04-08 5:42 ` Nirjhar Roy (IBM)
2025-04-01 6:43 ` [PATCH v2 4/5] common/config: Introduce _exit wrapper around exit command Nirjhar Roy (IBM)
2025-04-04 5:03 ` Ritesh Harjani
2025-04-01 6:44 ` [PATCH v2 5/5] common: exit --> _exit Nirjhar Roy (IBM)
2025-04-04 5:04 ` Ritesh Harjani
2025-04-07 16:19 ` Zorro Lang
2025-04-07 18:46 ` Ritesh Harjani
2025-04-07 19:12 ` Darrick J. Wong
2025-04-07 19:19 ` Nirjhar Roy (IBM)
2025-04-07 19:13 ` Nirjhar Roy (IBM)
2025-04-08 14:27 ` Zorro Lang
2025-04-08 14:33 ` Darrick J. Wong
2025-04-08 16:25 ` Nirjhar Roy (IBM)
2025-04-07 18:59 ` Nirjhar Roy (IBM)
2025-04-01 21:37 ` [PATCH v2 0/5] Minor cleanups in common/ Dave Chinner
2025-04-04 14:31 ` Nirjhar Roy (IBM)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ad86fdf39bfac1862960fb159bb2757e100db898.1743487913.git.nirjhar.roy.lists@gmail.com \
--to=nirjhar.roy.lists@gmail.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=zlang@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox