From: "Darrick J. Wong" <djwong@kernel.org>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Cc: fstests@vger.kernel.org, Ritesh Harjani <ritesh.list@gmail.com>,
john.g.garry@oracle.com
Subject: Re: [RFC 02/12] common/rc: Add a helper to run fsx on a given file
Date: Wed, 11 Jun 2025 07:31:38 -0700 [thread overview]
Message-ID: <20250611143138.GG6143@frogsfrogsfrogs> (raw)
In-Reply-To: <0a0604215a992f0aaa4d8d6821b8c8051a0f8d80.1749629233.git.ojaswin@linux.ibm.com>
On Wed, Jun 11, 2025 at 03:04:45PM +0530, Ojaswin Mujoo wrote:
> Currently run_fsx is hardcoded to run on a file in $TEST_DIR.
> Add a helper _run_fsx_on_file so that we can run fsx on any
> given file including in $SCRATCH_MNT. Also, refactor _run_fsx
> to use this helper.
>
> No functional change is intended in this patch.
>
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
> ---
> common/rc | 21 ++++++++++++++++++---
> 1 file changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/common/rc b/common/rc
> index cfbe2a5f..a5d811a1 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -5115,13 +5115,22 @@ _require_hugepage_fsx()
> _notrun "fsx binary does not support MADV_COLLAPSE"
> }
>
> -_run_fsx()
> +_run_fsx_on_file()
> {
> + local testfile=$1
> + shift
> +
> + if ! [ -f $testfile ]
> + then
> + echo "_run_fsx_on_file: $testfile doesn't exist. Creating" >> $seqres.full
> + touch $testfile
> + fi
> +
> echo "fsx $*"
> local args=`echo $@ | sed -e "s/ BSIZE / $bsize /g" -e "s/ PSIZE / $psize /g"`
> - set -- $FSX_PROG $args $FSX_AVOID $TEST_DIR/junk
> + set -- $FSX_PROG $args $FSX_AVOID $testfile
local testfile="${1:-$TEST_DIR/junk}"
...
set -- $FSX_PROG $args $FSX_AVOID $testfile
Then you don't need the extra helper.
--D
> echo "$@" >>$seqres.full
> - rm -f $TEST_DIR/junk
> + rm -f $testfile
> "$@" 2>&1 | tee -a $seqres.full >$tmp.fsx
> local res=${PIPESTATUS[0]}
> if [ $res -ne 0 ]; then
> @@ -5133,6 +5142,12 @@ _run_fsx()
> return 0
> }
>
> +_run_fsx()
> +{
> + _run_fsx_on_file $TEST_DIR/junk $@
> + return $?
> +}
> +
> # Run fsx with -h(ugepage buffers). If we can't set up a hugepage then skip
> # the test, but if any other error occurs then exit the test.
> _run_hugepage_fsx() {
> --
> 2.49.0
>
>
next prev parent reply other threads:[~2025-06-11 14:31 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 9:34 [RFC 00/12] Add more tests for multi fs block atomic writes Ojaswin Mujoo
2025-06-11 9:34 ` [RFC 01/12] common/preamble: Fix fsx for ext4 with bigalloc Ojaswin Mujoo
2025-06-11 14:30 ` Darrick J. Wong
2025-06-12 6:11 ` Ojaswin Mujoo
2025-06-12 14:36 ` Darrick J. Wong
2025-06-13 5:31 ` Ojaswin Mujoo
2025-06-13 15:04 ` Darrick J. Wong
2025-06-17 6:22 ` Ojaswin Mujoo
2025-06-30 15:27 ` Darrick J. Wong
2025-06-18 19:13 ` Zorro Lang
2025-06-20 6:21 ` Ojaswin Mujoo
2025-06-20 9:59 ` Zorro Lang
2025-06-11 9:34 ` [RFC 02/12] common/rc: Add a helper to run fsx on a given file Ojaswin Mujoo
2025-06-11 14:31 ` Darrick J. Wong [this message]
2025-06-12 6:17 ` Ojaswin Mujoo
2025-06-12 14:35 ` Darrick J. Wong
2025-06-11 9:34 ` [RFC 03/12] ltp/fsx.c: Add atomic writes support to fsx Ojaswin Mujoo
2025-06-11 14:35 ` Darrick J. Wong
2025-06-12 6:18 ` Ojaswin Mujoo
2025-06-11 9:34 ` [RFC 04/12] generic/767: Add atomic write test using fio crc check verifier Ojaswin Mujoo
2025-06-11 14:42 ` Darrick J. Wong
2025-06-12 6:22 ` Ojaswin Mujoo
2025-06-12 14:55 ` Darrick J. Wong
2025-06-18 19:34 ` Zorro Lang
2025-06-20 7:06 ` Ojaswin Mujoo
2025-06-11 9:34 ` [RFC 05/12] generic/769: Add atomic write test using fio verify on file mixed mappings Ojaswin Mujoo
2025-06-11 15:35 ` Darrick J. Wong
2025-06-11 9:34 ` [RFC 06/12] generic/770: Add atomic write multi-fsblock O_[D]SYNC tests Ojaswin Mujoo
2025-06-11 15:36 ` Darrick J. Wong
2025-06-12 6:23 ` Ojaswin Mujoo
2025-06-18 20:17 ` Zorro Lang
2025-06-20 8:20 ` Ojaswin Mujoo
2025-06-20 12:12 ` Zorro Lang
2025-06-11 9:34 ` [RFC 07/12] generic/771: Stress fsx with atomic writes enabled Ojaswin Mujoo
2025-06-11 14:45 ` Darrick J. Wong
2025-06-12 6:27 ` Ojaswin Mujoo
2025-06-12 15:14 ` Darrick J. Wong
2025-06-13 5:20 ` Ojaswin Mujoo
2025-06-18 20:27 ` Zorro Lang
2025-06-20 8:26 ` Ojaswin Mujoo
2025-06-11 9:34 ` [RFC 08/12] generic/772: Add sudden shutdown tests for multi block atomic writes Ojaswin Mujoo
2025-06-11 15:38 ` Darrick J. Wong
2025-06-12 6:28 ` Ojaswin Mujoo
2025-06-19 7:15 ` Zorro Lang
2025-06-20 11:11 ` Ojaswin Mujoo
2025-06-20 14:05 ` John Garry
2025-06-20 15:24 ` Ojaswin Mujoo
2025-06-11 9:34 ` [RFC 09/12] ext4/061: Atomic writes stress test for bigalloc using fio crc verifier Ojaswin Mujoo
2025-06-19 7:43 ` Zorro Lang
2025-06-20 15:08 ` Ojaswin Mujoo
2025-06-20 16:53 ` Zorro Lang
2025-06-11 9:34 ` [RFC 10/12] ext4/062: Atomic writes test for bigalloc using fio crc verifier on multiple files Ojaswin Mujoo
2025-06-12 10:26 ` John Garry
2025-06-13 5:37 ` Ojaswin Mujoo
2025-06-20 14:01 ` John Garry
2025-06-20 16:49 ` Ojaswin Mujoo
2025-06-19 7:45 ` Zorro Lang
2025-06-11 9:34 ` [RFC 11/12] ext4/063: Atomic write test for extent split across leaf nodes Ojaswin Mujoo
2025-06-19 7:52 ` Zorro Lang
2025-06-11 9:34 ` [RFC 12/12] ext4/064: Add atomic write tests for journal credit calculation Ojaswin Mujoo
2025-06-19 7:58 ` Zorro Lang
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=20250611143138.GG6143@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=john.g.garry@oracle.com \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.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