[PATCH blktests 1/4] nvme/rc: add zoned null_blk target helpers

Shin'ichiro Kawasaki shinichiro.kawasaki at wdc.com
Tue Oct 20 03:31:18 PDT 2026


On Oct 14, 2026 / 19:00, Andrea Parri wrote:
> Add helpers that export a zoned null_blk device as a namespace of the
> default subsystem and connect to it, tear that setup down again, and
> issue a partial Zone Management Receive and check its completion status.
> 
> The zone report tests added next share them.
> 
> Assisted-by: LLM
> Signed-off-by: Andrea Parri <parri.andrea at gmail.com>
> ---
>  tests/nvme/rc | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 61 insertions(+)
> 
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index c415ca1234407..270fad19d61f1 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -408,6 +408,67 @@ _nvmet_passthru_target_cleanup() {
>  	_remove_nvmet_host "${def_hostnqn}"
>  }
>  
> +# Export a zoned null_blk device as a namespace of the default subsystem and
> +# connect to it. Callers must source common/null_blk.
> +_nvmet_zoned_target_setup() {
> +	if ! _init_null_blk nr_devices=0; then
> +		return 1
> +	fi

I suggest to remove the three lines above. When null_blk module is loadable,
_configure_null_blk calls _init_null_blk. When null_blk module is built-in,
_init_null_blk just fails and should not be called.

> +	if ! _configure_null_blk nullb0 blocksize=512 size=1024 zoned=1 \

I suggest to use nullb1 instead of nullb0. When null_blk module is built-in,
nullb0 device is already created and not usable for blktests.

> +	     zone_size=1 power=1 >>"$FULL" 2>&1; then
> +		echo "could not configure zoned null_blk device"
> +		return 1
> +	fi
> +
> +	_nvmet_target_setup --blkdev none
> +	_create_nvmet_ns --blkdev /dev/nullb0 --uuid "$def_subsys_uuid" \

Again, I suggest s/nullb0/nullb1/



More information about the Linux-nvme mailing list