public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, zlang@redhat.com
Subject: Re: [PATCH v5 2/6] fstests: common/rc: fix unset seqres in _set_fs_sysfs_attr
Date: Tue, 8 Apr 2025 23:10:43 +0800	[thread overview]
Message-ID: <06bcbb2b-934d-4b66-8ed8-9acaf1072a28@oracle.com> (raw)
In-Reply-To: <20250407165847.GA6258@frogsfrogsfrogs>



On 8/4/25 00:58, Darrick J. Wong wrote:
> On Mon, Apr 07, 2025 at 11:48:16AM +0800, Anand Jain wrote:
>> Ensure logs don’t write to a `.full` file when `_set_fs_sysfs_attr()`
>> is called during setup (before a testcase) in XFS due to unset seqres.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>>   common/rc | 11 +++++++++--
>>   1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/common/rc b/common/rc
>> index e89eee5de840..ca1d13ca1f0b 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -5201,6 +5201,13 @@ _set_fs_sysfs_attr()
>>   	local attr=$1
>>   	shift
>>   	local content="$*"
>> +	local logfile="/dev/null"
> 
> If we're not actually running a test, should the error output go to
> $check.full instead?
> 

Ah. I didn't know. It seems like no one is using check.full.

-----
$ find . -type f -exec grep check\.full {} \; -print
	rm -f $check.full
./check
-----

Thanks, Anand


> --D
> 
>> +
>> +	# This function may be called outside a testcase during setup,
>> +	# so seqres might not be set.
>> +	if [[ -v seqres ]]; then
>> +		logfile="$seqres.full"
>> +	fi
>>   
>>   	if [ ! -b "$dev" -o -z "$attr" -o -z "$content" ];then
>>   		_fail "Usage: _set_fs_sysfs_attr <mounted_device> <attr> <content>"
>> @@ -5208,8 +5215,8 @@ _set_fs_sysfs_attr()
>>   
>>   	local dname=$(_fs_sysfs_dname $dev)
>>   
>> -	echo "echo '$content' 2>&1 > /sys/fs/${FSTYP}/${dname}/${attr}" >> $seqres.full
>> -	echo "$content" 2>&1 > /sys/fs/${FSTYP}/${dname}/${attr} | tee -a $seqres.full
>> +	echo "echo '$content' 2>&1 > /sys/fs/${FSTYP}/${dname}/${attr}" >> $logfile
>> +	echo "$content" 2>&1 > /sys/fs/${FSTYP}/${dname}/${attr} | tee -a $logfile
>>   }
>>   
>>   # Print the content of /sys/fs/$FSTYP/$DEV/$ATTR
>> -- 
>> 2.47.0
>>
>>


  reply	other threads:[~2025-04-08 15:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  3:48 [PATCH v5 0/6] fstests: btrfs: add test case to validate sysfs input arguments Anand Jain
2025-04-07  3:48 ` [PATCH v5 1/6] fstests: common/rc: set_fs_sysfs_attr: redirect errors to stdout Anand Jain
2025-04-07  3:48 ` [PATCH v5 2/6] fstests: common/rc: fix unset seqres in _set_fs_sysfs_attr Anand Jain
2025-04-07 16:58   ` Darrick J. Wong
2025-04-08 15:10     ` Anand Jain [this message]
2025-04-08 16:10       ` Darrick J. Wong
2025-04-07  3:48 ` [PATCH v5 3/6] fstests: filter: helper for sysfs error filtering Anand Jain
2025-04-07  3:48 ` [PATCH v5 4/6] fstests: common/sysfs: add new file sysfs and helpers Anand Jain
2025-04-07 17:22   ` Darrick J. Wong
2025-04-08 16:05     ` Anand Jain
2025-04-08 16:11       ` Darrick J. Wong
2025-04-07  3:48 ` [PATCH v5 5/6] fstests: btrfs: testcase for sysfs policy syntax verification Anand Jain
2025-04-07  3:48 ` [PATCH v5 6/6] fstests: btrfs: testcase for sysfs chunk_size attribute validation Anand Jain

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=06bcbb2b-934d-4b66-8ed8-9acaf1072a28@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.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