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 v4 4/6] check,common{rc,preamble}: Decouple init_rc() call from sourcing common/rc
Date: Wed, 9 Apr 2025 07:00:50 +0000 [thread overview]
Message-ID: <419090f011da6494c5bf20db768bcb8f646737df.1744181682.git.nirjhar.roy.lists@gmail.com> (raw)
In-Reply-To: <cover.1744181682.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>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
---
check | 2 ++
common/preamble | 1 +
common/rc | 2 --
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/check b/check
index 3d621210..9451c350 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-09 7:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 7:00 [PATCH v4 0/6] Minor cleanups in common/ Nirjhar Roy (IBM)
2025-04-09 7:00 ` [PATCH v4 1/6] generic/749: Remove redundant sourcing of common/rc Nirjhar Roy (IBM)
2025-04-09 7:00 ` [PATCH v4 2/6] generic/367: Remove redundant sourcing of common/config Nirjhar Roy (IBM)
2025-04-09 15:21 ` Darrick J. Wong
2025-04-09 7:00 ` [PATCH v4 3/6] check: Remove redundant _test_mount in check Nirjhar Roy (IBM)
2025-04-09 15:21 ` Darrick J. Wong
2025-04-09 7:00 ` Nirjhar Roy (IBM) [this message]
2025-04-09 15:22 ` [PATCH v4 4/6] check,common{rc,preamble}: Decouple init_rc() call from sourcing common/rc Darrick J. Wong
2025-04-09 7:00 ` [PATCH v4 5/6] common/config: Introduce _exit wrapper around exit command Nirjhar Roy (IBM)
2025-04-09 15:23 ` Darrick J. Wong
2025-04-09 7:00 ` [PATCH v4 6/6] common: exit --> _exit Nirjhar Roy (IBM)
2025-04-09 15:24 ` Darrick J. Wong
2025-04-09 16:29 ` Nirjhar Roy (IBM)
2025-04-10 14:31 ` Zorro Lang
2025-04-10 16:29 ` Darrick J. Wong
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=419090f011da6494c5bf20db768bcb8f646737df.1744181682.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