lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1d07e5657c2817c74e939894bb554424199fd290.1741248214.git.nirjhar.roy.lists@gmail.com>
Date: Thu,  6 Mar 2025 08:17:41 +0000
From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@...il.com>
To: fstests@...r.kernel.org
Cc: linux-ext4@...r.kernel.org,
	linux-xfs@...r.kernel.org,
	ritesh.list@...il.com,
	ojaswin@...ux.ibm.com,
	djwong@...nel.org,
	zlang@...nel.org,
	david@...morbit.com,
	nirjhar.roy.lists@...il.com
Subject: [PATCH v1 2/2] check,common/{preamble,rc},soak: Decoupling init_rc() call from sourcing common/rc

Silently executing scripts during sourcing common/rc doesn't look good
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@...il.com>
---
 check           | 10 ++--------
 common/preamble |  1 +
 common/rc       |  2 --
 soak            |  1 +
 4 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/check b/check
index ea92b0d6..d30af1ba 100755
--- a/check
+++ b/check
@@ -840,16 +840,8 @@ function run_section()
 		_prepare_test_list
 	elif [ "$OLD_TEST_FS_MOUNT_OPTS" != "$TEST_FS_MOUNT_OPTS" ]; then
 		_test_unmount 2> /dev/null
-		if ! _test_mount
-		then
-			echo "check: failed to mount $TEST_DEV on $TEST_DIR"
-			status=1
-			exit
-		fi
 	fi
 
-	init_rc
-
 	seq="check.$$"
 	check="$RESULT_BASE/check"
 
@@ -870,6 +862,8 @@ function run_section()
 	needwrap=true
 
 	if [ ! -z "$SCRATCH_DEV" ]; then
+		_check_mounted_on SCRATCH_DEV $SCRATCH_DEV SCRATCH_MNT $SCRATCH_MNT
+		[ $? -le 1 ] || exit 1
 	  _scratch_unmount 2> /dev/null
 	  # call the overridden mkfs - make sure the FS is built
 	  # the same as we'll create it later.
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 d2de8588..f153ad81 100644
--- a/common/rc
+++ b/common/rc
@@ -5754,8 +5754,6 @@ _require_program() {
 	_have_program "$1" || _notrun "$tag required"
 }
 
-init_rc
-
 ################################################################################
 # make sure this script returns success
 /bin/true
diff --git a/soak b/soak
index d5c4229a..5734d854 100755
--- a/soak
+++ b/soak
@@ -5,6 +5,7 @@
 
 # get standard environment, filters and checks
 . ./common/rc
+# ToDo: Do we need an init_rc() here? How is soak used?
 . ./common/filter
 
 tmp=/tmp/$$
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ