public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>
To: Zorro Lang <zlang@redhat.com>
Cc: fstests@vger.kernel.org, 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
Subject: Re: [PATCH v1 2/2] check,common/{preamble,rc},soak: Decoupling init_rc() call from sourcing common/rc
Date: Fri, 7 Mar 2025 11:26:56 +0530	[thread overview]
Message-ID: <c4fc5048-77fb-410b-b204-308881b9a23c@gmail.com> (raw)
In-Reply-To: <20250306211357.fnruffn2nkbiyx5b@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>


On 3/7/25 02:43, Zorro Lang wrote:
> On Thu, Mar 06, 2025 at 08:17:41AM +0000, Nirjhar Roy (IBM) wrote:
>> 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@gmail.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
> Why remove these lines?

Darrick has asked the same question [1]. Basically I have already added 
init_rc() call to _begin_fstests() which will do the _test_mount() so we 
don't need the above lines, right?


[1] 
https://lore.kernel.org/all/716e0d26-7728-42bb-981d-aae89ef50d7f@gmail.com/

>
>>   	fi
>>   
>> -	init_rc
> Doesn't the "check" need init_rc at here?
Same reason as above.
>
>> -
>>   	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
>           ^^^^^^^
>           Different indent with below code.
>
> This looks like part of init_rc. If you don't remove above init_rc, can this
> change be saved?
>
>>   	  _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?
> I never noticed we have this file... this file was create by:
>
>    commit 27fba05e66981c239c3be7a7e5a3aa0d8dc59247
>    Author: Nathan Scott <nathans@sgi.com>
>    Date:   Mon Jan 15 05:01:19 2001 +0000
>
>        cmd/xfs/stress/001 1.6 Renamed to cmd/xfstests/001
>
> I can't understand the relationship of this commit with this file. Does
> anyone learn about the history of it.
>
> I tried to "grep" the whole fstests, looks like nothing uses this file.
> Maybe we should remove it?

Okay. I can see Dave suggesting something similar and has also given a 
sample patch where he is planning to do the same[2].

[2] https://lore.kernel.org/all/Z8oT_tBYG-a79CjA@dread.disaster.area/

--NR


>
> Thanks,
> Zorro
>
>>   . ./common/filter
>>   
>>   tmp=/tmp/$$
>> -- 
>> 2.34.1
>>
>>
-- 
Nirjhar Roy
Linux Kernel Developer
IBM, Bangalore


  reply	other threads:[~2025-03-07  5:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06  8:17 [PATCH v1 0/2] Minor cleanups in common/rc Nirjhar Roy (IBM)
2025-03-06  8:17 ` [PATCH v1 1/2] generic/749: Remove redundant sourcing of common/rc Nirjhar Roy (IBM)
2025-03-06 17:41   ` Darrick J. Wong
2025-03-06  8:17 ` [PATCH v1 2/2] check,common/{preamble,rc},soak: Decoupling init_rc() call from sourcing common/rc Nirjhar Roy (IBM)
2025-03-06 17:46   ` Darrick J. Wong
2025-03-07  5:51     ` Nirjhar Roy (IBM)
2025-03-07 17:40       ` Darrick J. Wong
2025-03-12  5:46         ` Nirjhar Roy (IBM)
2025-03-18  4:57           ` Nirjhar Roy (IBM)
2025-03-06 21:13   ` Zorro Lang
2025-03-07  5:56     ` Nirjhar Roy (IBM) [this message]
2025-03-06 21:30   ` Dave Chinner
2025-03-07  8:05     ` Nirjhar Roy (IBM)
2025-03-08  7:20       ` Zorro Lang
2025-03-10  8:06         ` Zorro Lang
2025-03-12  4:41           ` Nirjhar Roy (IBM)
2025-03-12  4:41         ` 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=c4fc5048-77fb-410b-b204-308881b9a23c@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 \
    --cc=zlang@redhat.com \
    /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