From: "Darrick J. Wong" <djwong@kernel.org>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Cc: Zorro Lang <zlang@redhat.com>,
fstests@vger.kernel.org, Ritesh Harjani <ritesh.list@gmail.com>,
john.g.garry@oracle.com, tytso@mit.edu,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-ext4@vger.kernel.org
Subject: Re: [PATCH v7 02/12] common/rc: Add fio atomic write helpers
Date: Fri, 19 Sep 2025 09:27:16 -0700 [thread overview]
Message-ID: <20250919162716.GD8117@frogsfrogsfrogs> (raw)
In-Reply-To: <8e87c6c800f6ca53f0c89af554b85197c7e397f1.1758264169.git.ojaswin@linux.ibm.com>
On Fri, Sep 19, 2025 at 12:17:55PM +0530, Ojaswin Mujoo wrote:
> The main motivation of adding this function on top of _require_fio is
> that there has been a case in fio where atomic= option was added but
> later it was changed to noop since kernel didn't yet have support for
> atomic writes. It was then again utilized to do atomic writes in a later
> version, once kernel got the support. Due to this there is a point in
> fio where _require_fio w/ atomic=1 will succeed even though it would
> not be doing atomic writes.
>
> Hence, add an internal helper __require_fio_version to require specific
> versions of fio to work past such issues. Further, add the high level
> _require_fio_atomic_writes helper which tests can use to ensure fio
> has the right version for atomic writes.
>
> Reviewed-by: Zorro Lang <zlang@redhat.com>
> Reviewed-by: John Garry <john.g.garry@oracle.com>
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Looks ok to me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> common/rc | 43 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/common/rc b/common/rc
> index 28fbbcbb..8a023b9d 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -6000,6 +6000,49 @@ _max() {
> echo $ret
> }
>
> +# Due to reasons explained in fio commit 40f1fc11d, fio version between
> +# v3.33 and v3.38 have atomic= feature but it is a no-op and doesn't do
> +# RWF_ATOMIC write. Hence, use this helper to ensure fio has the
> +# required support. Currently, the simplest way we have is to ensure
> +# the version.
> +_require_fio_atomic_writes() {
> + __require_fio_version "3.38+"
> +}
> +
> +# Check the required fio version. Examples:
> +# __require_fio_version 3.38 (matches 3.38 only)
> +# __require_fio_version 3.38+ (matches 3.38 and above)
> +# __require_fio_version 3.38- (matches 3.38 and below)
> +#
> +# Internal helper, avoid using directly in tests.
> +__require_fio_version() {
> + local req_ver="$1"
> + local fio_ver
> +
> + _require_fio
> + _require_math
> +
> + fio_ver=$(fio -v | cut -d"-" -f2)
> +
> + case "$req_ver" in
> + *+)
> + req_ver=${req_ver%+}
> + test $(_math "$fio_ver >= $req_ver") -eq 1 || \
> + _notrun "need fio >= $req_ver (found $fio_ver)"
> + ;;
> + *-)
> + req_ver=${req_ver%-}
> + test $(_math "$fio_ver <= $req_ver") -eq 1 || \
> + _notrun "need fio <= $req_ver (found $fio_ver)"
> + ;;
> + *)
> + req_ver=${req_ver%-}
> + test $(_math "$fio_ver == $req_ver") -eq 1 || \
> + _notrun "need fio = $req_ver (found $fio_ver)"
> + ;;
> + esac
> +}
> +
> ################################################################################
> # make sure this script returns success
> /bin/true
> --
> 2.49.0
>
next prev parent reply other threads:[~2025-09-19 16:27 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 6:47 [PATCH v7 00/11] Add more tests for multi fs block atomic writes Ojaswin Mujoo
2025-09-19 6:47 ` [PATCH v7 01/12] common/rc: Add _min() and _max() helpers Ojaswin Mujoo
2025-09-19 6:47 ` [PATCH v7 02/12] common/rc: Add fio atomic write helpers Ojaswin Mujoo
2025-09-19 16:27 ` Darrick J. Wong [this message]
2025-09-19 6:47 ` [PATCH v7 03/12] common/rc: Add a helper to run fsx on a given file Ojaswin Mujoo
2025-09-19 6:47 ` [PATCH v7 04/12] ltp/fsx.c: Add atomic writes support to fsx Ojaswin Mujoo
2025-09-28 8:55 ` Zorro Lang
2025-09-28 13:19 ` Zorro Lang
2025-10-02 17:56 ` Ojaswin Mujoo
2025-10-03 17:19 ` Zorro Lang
2025-10-05 12:57 ` Ojaswin Mujoo
2025-10-05 15:39 ` Zorro Lang
2025-10-06 13:20 ` Ojaswin Mujoo
2025-10-07 9:58 ` Ojaswin Mujoo
2025-10-17 16:01 ` Zorro Lang
2025-10-17 16:27 ` Darrick J. Wong
2025-10-17 18:47 ` Zorro Lang
2025-10-17 22:52 ` Darrick J. Wong
2025-10-20 10:33 ` John Garry
2025-10-21 10:28 ` Ojaswin Mujoo
2025-10-21 11:30 ` Brian Foster
2025-10-21 11:58 ` Ojaswin Mujoo
2025-10-21 17:44 ` Darrick J. Wong
2025-10-22 7:40 ` Ojaswin Mujoo
2025-10-23 15:44 ` John Garry
2025-10-23 17:55 ` Darrick J. Wong
2025-10-29 18:11 ` [PATCH] xfs: fix write failures in software-provided atomic writes Darrick J. Wong
2025-10-29 18:13 ` Darrick J. Wong
2025-10-30 13:52 ` John Garry
2025-10-30 15:01 ` Darrick J. Wong
2025-10-30 16:35 ` John Garry
2025-10-30 19:38 ` John Garry
2025-10-31 4:30 ` Darrick J. Wong
2025-10-31 10:17 ` John Garry
2025-10-31 17:13 ` Darrick J. Wong
2025-11-03 12:16 ` John Garry
2025-11-03 18:01 ` Darrick J. Wong
2025-10-31 8:08 ` Ojaswin Mujoo
2025-10-31 10:04 ` John Garry
2025-09-19 6:47 ` [PATCH v7 05/12] generic: Add atomic write test using fio crc check verifier Ojaswin Mujoo
2025-10-28 9:42 ` Ojaswin Mujoo
2025-11-01 9:00 ` Zorro Lang
2025-09-19 6:47 ` [PATCH v7 06/12] generic: Add atomic write test using fio verify on file mixed mappings Ojaswin Mujoo
2025-09-19 6:48 ` [PATCH v7 07/12] generic: Add atomic write multi-fsblock O_[D]SYNC tests Ojaswin Mujoo
2025-09-19 6:48 ` [PATCH v7 08/12] generic: Stress fsx with atomic writes enabled Ojaswin Mujoo
2025-09-19 6:48 ` [PATCH v7 09/12] generic: Add sudden shutdown tests for multi block atomic writes Ojaswin Mujoo
2025-09-19 6:48 ` [PATCH v7 10/12] ext4: Test atomic write and ioend codepaths with bigalloc Ojaswin Mujoo
2025-09-19 6:48 ` [PATCH v7 11/12] ext4: Test atomic writes allocation and write " Ojaswin Mujoo
2025-09-19 6:48 ` [PATCH v7 12/12] ext4: Atomic write test for extent split across leaf nodes Ojaswin Mujoo
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=20250919162716.GD8117@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=john.g.garry@oracle.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=tytso@mit.edu \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.