FS/XFS testing framework
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@kernel.org>
To: Andrey Albershteyn <aalbersh@kernel.org>
Cc: fstests@vger.kernel.org, ojaswin@linux.ibm.com, hch@lst.de
Subject: Re: [PATCH v2] check: set seqres before calling init_rc which could write there
Date: Tue, 3 Nov 2026 20:15:21 +0800	[thread overview]
Message-ID: <aunJIPo777UWbpd4@zlang-mailbox> (raw)
In-Reply-To: <20261103093116.2850916-2-aalbersh@kernel.org>

On Tue, Nov 03, 2026 at 10:31:17AM +0100, Andrey Albershteyn wrote:
> There's path where >>$seqres is used in init_rc:
> 
> -> init_rc
> 	-> _test_mount
> 		-> _prepare_for_eio_shutdown
> 			->_xfs_prepare_for_eio_shutdown
> 				-> _set_fs_sysfs_attr
> 
> Which will try to write to .full because $seqres is not set. Fix this by
> setting seqres first, this way it should go to $RESULT_DIR/check.full.
> 
> The init_rc is called in the top context and then per section, however,
> for top context we don't have environment set up yet. These logs are
> just a few sysfs_attr writes and aren't that important, so, let's save
> those to /tmp/xxx.check.full just in case.
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
> ---
> Changes in v2:
> - remove The before init_rc in the comment
> ---
>  check | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/check b/check
> index 534c2cdf7a06..afe855bcf0ed 100755
> --- a/check
> +++ b/check
> @@ -534,6 +534,10 @@ if ! . ./common/rc; then
>  	_fatal "check: failed to source common/rc"
>  fi
>  
> +# init_rc could write to the $seqres.full, however we don't have any context
> +# here yet, and no RESULT_BASE is setup. These logs aren't that important but
> +# let's keep them in /tmp anyway.
> +seqres=$tmp.check

The code around init_rc is definitely messy and deserves a proper refactor.
For this patch specifically, though, it looks good to me.

Reviewed-by: Zorro Lang <zlang@kernel.org>

>  init_rc
>  
>  # If the test config specified a soak test duration, see if there are any
> @@ -932,8 +936,6 @@ function run_section()
>  		_test_unmount 2> /dev/null
>  	fi
>  
> -	init_rc
> -
>  	seq="check.$$"
>  	check="$RESULT_BASE/check"
>  	seqres="$check"
> @@ -941,6 +943,8 @@ function run_section()
>  	# don't leave old full output behind on a clean run
>  	rm -f $check.full
>  
> +	init_rc
> +
>  	[ -f $check.time ] || touch $check.time
>  
>  	# print out our test configuration
> -- 
> 2.54.0
> 

      reply	other threads:[~2026-11-03 12:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  9:31 [PATCH v2] check: set seqres before calling init_rc which could write there Andrey Albershteyn
2026-11-03 12:15 ` Zorro Lang [this message]

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=aunJIPo777UWbpd4@zlang-mailbox \
    --to=zlang@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=hch@lst.de \
    --cc=ojaswin@linux.ibm.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