From: John Garry <john.g.garry@oracle.com>
To: Catherine Hoang <catherine.hoang@oracle.com>,
linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH v4] generic: add a test for atomic writes
Date: Tue, 8 Apr 2025 17:24:44 +0100 [thread overview]
Message-ID: <feaabfc0-1fe3-445a-8816-c72d52132ed2@oracle.com> (raw)
In-Reply-To: <20250408075933.32541-1-catherine.hoang@oracle.com>
On 08/04/2025 08:59, Catherine Hoang wrote:
> Add a test to validate the new atomic writes feature.
>
> Signed-off-by: Catherine Hoang<catherine.hoang@oracle.com>
> Reviewed-by: Nirjhar Roy (IBM)<nirjhar.roy.lists@gmail.com>
Please see comment below, but this seems ok apart from that:
Reviewed-by: John Garry <john.g.garry@oracle.com>
> ---
> common/rc | 51 +++++++++++++
> tests/generic/765 | 172 ++++++++++++++++++++++++++++++++++++++++++
> tests/generic/765.out | 2 +
> 3 files changed, 225 insertions(+)
> create mode 100755 tests/generic/765
> create mode 100644 tests/generic/765.out
>
> diff --git a/common/rc b/common/rc
> index 16d627e1..25e6a1f7 100644
> +}
> +
> +sys_min_write=$(cat "/sys/block/$(_short_dev $SCRATCH_DEV)/queue/atomic_write_unit_min_bytes")
> +sys_max_write=$(cat "/sys/block/$(_short_dev $SCRATCH_DEV)/queue/atomic_write_unit_max_bytes")
> +
> +bdev_min_write=$(_get_atomic_write_unit_min $SCRATCH_DEV)
> +bdev_max_write=$(_get_atomic_write_unit_max $SCRATCH_DEV)
> +
> +if [ "$sys_min_write" -ne "$bdev_min_write" ]; then
> + echo "bdev min write != sys min write"
> +fi
> +if [ "$sys_max_write" -ne "$bdev_max_write" ]; then
> + echo "bdev max write != sys max write"
Note: for large atomic writes according to [0], these may not be the
same. I am not sure how this will affect your test.
[0]
https://lore.kernel.org/linux-xfs/20250408104209.1852036-1-john.g.garry@oracle.com/T/#m374933d93697082f9267515f807930d774c8634b
> +fi
> +
> +# Test all supported block sizes between bdev min and max
> +for ((bsize=$bdev_min_write; bsize<=bdev_max_write; bsize*=2)); do
> + test_atomic_writes $bsize
> +done;
> +
> +# Check that atomic write fails if bsize < bdev min or bsize > bdev max
> +test_atomic_write_bounds $((bdev_min_write / 2))
> +test_atomic_write_bounds $((bdev_max_write * 2))
> +
> +# success, all done
> +echo Silence is golden
> +status=0
> +exit
> diff --git a/tests/generic/765.out b/tests/generic/765.out
> new file mode 100644
> index 00000000..39c254ae
> --- /dev/null
> +++ b/tests/generic/765.out
> @@ -0,0 +1,2 @@
> +QA output created by 765
> +Silence is golden
> -- 2.34.1
>
next prev parent reply other threads:[~2025-04-08 16:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 7:59 [PATCH v4] generic: add a test for atomic writes Catherine Hoang
2025-04-08 16:24 ` John Garry [this message]
2025-04-08 20:44 ` Catherine Hoang
2025-04-09 9:54 ` John Garry
2025-04-08 18:15 ` Darrick J. Wong
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=feaabfc0-1fe3-445a-8816-c72d52132ed2@oracle.com \
--to=john.g.garry@oracle.com \
--cc=catherine.hoang@oracle.com \
--cc=fstests@vger.kernel.org \
--cc=linux-xfs@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 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.