All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Andrea Parri <parri.andrea@gmail.com>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	 Keith Busch <kbusch@kernel.org>,
	Sagi Grimberg <sagi@grimberg.me>,
	 Chaitanya Kulkarni <kch@nvidia.com>,
	Daniel Wagner <dwagner@suse.de>,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH blktests 3/4] nvme/072: test nvmet zone report initialization and length
Date: Tue, 20 Oct 2026 19:38:10 +0900	[thread overview]
Message-ID: <atdEJT_j9ciVuAiY@shinmob> (raw)
In-Reply-To: <20261014170046.2516-4-parri.andrea@gmail.com>

On Oct 14, 2026 / 19:00, Andrea Parri wrote:
> Export a zoned null_blk device through the NVMe target and verify that
> Zone Management Receive zeroes reserved and unused report bytes and
> rejects a transfer length inconsistent with NUMD. The test runs on every
> configured transport, with RDMA restricted to 4 KiB page kernels so that
> the preparatory write exceeds the default inline-data limit. Add a small
> passthrough helper because nvme-cli does not expose the reserved report
> bytes.
> 
> The test fails on the unpatched kernel and passes with the fix applied.
> 
> Assisted-by: LLM
> Signed-off-by: Andrea Parri <parri.andrea@gmail.com>

[...]

> diff --git a/tests/nvme/072 b/tests/nvme/072
> new file mode 100755
> index 0000000000000..c7bcf93ab4d20
> --- /dev/null
> +++ b/tests/nvme/072
> @@ -0,0 +1,68 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-3.0+
> +# Copyright (C) 2026 Andrea Parri
> +#
> +# Check that NVMe target zone reports are fully initialized and that their
> +# transfer length matches NUMD.
> +#
> +# Regression test for patch "nvmet: zns: don't leak stale memory in zone
> +# management receive".
> +
> +. tests/nvme/rc
> +. common/null_blk
> +
> +DESCRIPTION="check NVMe target zone report initialization and length"
> +QUICK=1
> +
> +requires() {
> +	_nvme_requires
> +	_have_loop
> +	_require_kernel_nvme_target
> +	_have_module null_blk

I suggest to call _have_null_blk instead of the line above. It will allow
built-in null_blk module.

> +	_have_kernel_options BLK_DEV_ZONED
> +	_have_src_program nvme-zone-report
> +
> +	# RDMA defaults to PAGE_SIZE bytes of inline data. The helper's
> +	# 8 KiB preparatory write must exceed that limit.
> +	if [[ "$nvme_trtype" == "rdma" ]]; then
> +		_page_size_equals 4096
> +	fi
> +}
> +
> +set_conditions() {
> +	_set_nvme_trtype "$@"
> +}
> +
> +test() {
> +	echo "Running ${TEST_NAME}"
> +
> +	local block_size dev last_sector ret sectors slba zone_sectors
> +
> +	_setup_nvmet
> +	_register_test_cleanup _cleanup_nvmet_zoned_target
> +	if ! _nvmet_zoned_target_setup; then
> +		return 1
> +	fi
> +	dev="/dev/$(_find_nvme_ns "$def_subsys_uuid")"
> +
> +	sectors=$(cat /sys/block/nullb0/size)
> +	zone_sectors=$(cat /sys/block/nullb0/queue/chunk_sectors)
> +	block_size=$(cat /sys/block/nullb0/queue/logical_block_size)

Again, I suggest s/nullb0/nullb1/

> +	last_sector=$(((sectors - 1) / zone_sectors * zone_sectors))
> +	slba=$((last_sector * 512 / block_size))
> +
> +	src/nvme-zone-report "$dev" "$slba" >>"$FULL" 2>&1
> +	ret=$?
> +	case $ret in
> +	0) ;;
> +	1) echo "zone report contained stale data" ;;
> +	*) echo "zone report checker failed" ;;
> +	esac
> +
> +	_check_zone_report "$dev" 4096 1023 0
> +	_check_zone_report "$dev" 8192 1023 15
> +
> +	_nvmet_zoned_target_cleanup
> +
> +	echo "Test complete"
> +}

  reply	other threads:[~2026-10-20 10:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 17:00 [PATCH blktests 0/4] nvme: add nvmet zone report and FC regression tests Andrea Parri
2026-10-14 17:00 ` [PATCH blktests 1/4] nvme/rc: add zoned null_blk target helpers Andrea Parri
2026-10-20 10:31   ` Shin'ichiro Kawasaki
2026-10-14 17:00 ` [PATCH blktests 2/4] nvme/071: test that nvmet sends no data for a failed read Andrea Parri
2026-10-20 10:35   ` Shin'ichiro Kawasaki
2026-10-20 15:17     ` Andrea Parri
2026-10-14 17:00 ` [PATCH blktests 3/4] nvme/072: test nvmet zone report initialization and length Andrea Parri
2026-10-20 10:38   ` Shin'ichiro Kawasaki [this message]
2026-10-14 17:00 ` [PATCH blktests 4/4] nvme/073: test that nvmet rejects a zone report NUMD that wraps Andrea Parri
2026-10-20 10:41 ` [PATCH blktests 0/4] nvme: add nvmet zone report and FC regression tests Shin'ichiro Kawasaki
2026-10-20 15:18   ` Andrea Parri

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=atdEJT_j9ciVuAiY@shinmob \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=dwagner@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=parri.andrea@gmail.com \
    --cc=sagi@grimberg.me \
    /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.