public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Anand Jain <anand.jain@oracle.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org,
	david@fromorbit.com
Subject: Re: [PATCH v3 1/5] fstests: common/rc: set_fs_sysfs_attr: redirect errors to stdout
Date: Mon, 24 Feb 2025 10:18:54 -0800	[thread overview]
Message-ID: <20250224181854.GB21799@frogsfrogsfrogs> (raw)
In-Reply-To: <e18babf503e66ce798c3df4353174afd4f771303.1740395948.git.anand.jain@oracle.com>

On Mon, Feb 24, 2025 at 08:15:04PM +0800, Anand Jain wrote:
> Redirect sysfs write errors to stdout as a preparatory patch to enable
> testing of expected sysfs write failures. Also, log the executed
> sysfs write command and its failure if any to seqres.full for better
> debugging and traceability.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
>  common/rc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/common/rc b/common/rc
> index cf6316a224ff..942e201649dd 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -5081,7 +5081,8 @@ _set_fs_sysfs_attr()
>  
>  	local dname=$(_fs_sysfs_dname $dev)
>  
> -	echo "$content" > /sys/fs/${FSTYP}/${dname}/${attr}
> +	echo "echo "$content" 2>&1 > /sys/fs/${FSTYP}/${dname}/${attr}" >> $seqres.full

Did you mean to    ^ escape ^ these double-quotes?  Without it,
whitespace in $content might not be logged correctly.

--D

> +	echo "$content" 2>&1 > /sys/fs/${FSTYP}/${dname}/${attr} | tee -a $seqres.full
>  }
>  
>  # Print the content of /sys/fs/$FSTYP/$DEV/$ATTR
> -- 
> 2.43.5
> 
> 

  reply	other threads:[~2025-02-24 18:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 12:15 [PATCH v3 0/5] fstests: btrfs: add test case to validate sysfs input arguments Anand Jain
2025-02-24 12:15 ` [PATCH v3 1/5] fstests: common/rc: set_fs_sysfs_attr: redirect errors to stdout Anand Jain
2025-02-24 18:18   ` Darrick J. Wong [this message]
2025-02-25  0:20     ` Anand Jain
2025-02-24 12:15 ` [PATCH v3 2/5] fstests: filter: helper for sysfs error filtering Anand Jain
2025-02-24 12:15 ` [PATCH v3 3/5] fstests: common/rc: add sysfs argument verification helpers Anand Jain
2025-02-24 12:15 ` [PATCH v3 4/5] fstests: btrfs: testcase for sysfs policy syntax verification Anand Jain
2025-02-24 12:15 ` [PATCH v3 5/5] 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=20250224181854.GB21799@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=anand.jain@oracle.com \
    --cc=david@fromorbit.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.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