[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fbe22939-f1bf-40bd-8ed1-d818167479d3@gmail.com>
Date: Tue, 8 Apr 2025 11:12:58 +0530
From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@...il.com>
To: "Ritesh Harjani (IBM)" <ritesh.list@...il.com>, fstests@...r.kernel.org
Cc: linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org,
ojaswin@...ux.ibm.com, djwong@...nel.org, zlang@...nel.org,
david@...morbit.com
Subject: Re: [PATCH v2 3/5] check,common{rc,preamble}: Decouple init_rc() call
from sourcing common/rc
On 4/4/25 09:30, Ritesh Harjani (IBM) wrote:
> "Nirjhar Roy (IBM)" <nirjhar.roy.lists@...il.com> writes:
>
>> 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.
> This patch looks good to me. Please feel free to add:
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>
>
>
> While reviewing this patch, I also noticed couple of related cleanups
> which you might be interested in:
>
> 1. common/rc sources common/config which executes a function
> _canonicalize_devices()
>
> 2. tests/generic/367 sources common/config which is not really
> required since _begin_fstests() will anyways source common/rc and
> common/config will get sourced automatically.
Addressed 2 in [v3].
[v3]
https://lore.kernel.org/all/ffefbe485f71206dd2a0a27256d1101d2b0c7a64.1744090313.git.nirjhar.roy.lists@gmail.com/
Thanks.
--NR
>
> -ritesh
>
>> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@...il.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
--
Nirjhar Roy
Linux Kernel Developer
IBM, Bangalore
Powered by blists - more mailing lists