[PATCH blktests] block tests: nvme metadata passthrough
Shinichiro Kawasaki
shinichiro.kawasaki at wdc.com
Sat Jun 7 05:54:50 PDT 2025
On Jun 05, 2025 / 17:30, Keith Busch wrote:
> From: Keith Busch <kbusch at kernel.org>
>
> Get more coverage on nvme metadata passthrough. Specifically in this
> test, read-only metadata is targeted as this had been a gap in previous
> test coveraged.
Thanks for the patch. I ran the test case on the kernel v6.15, and it passed.
Is this pass result expected? I guess this test case intends to extend test
coverage, and does not intend to recreate the failure reported in the Link.
So, I'm guessing the test case should pass with v6.15 kernel.
Also, please find a few comments in line.
...
> diff --git a/tests/nvme/064 b/tests/nvme/064
> new file mode 100755
> index 0000000..ed9c565
> --- /dev/null
> +++ b/tests/nvme/064
> @@ -0,0 +1,22 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-3.0+
> +# Copyright (C) 2025 Keith Busch <kbusch at kernel.org>
> +#
> +# Test out metadata through the passthrough interfaces
> +
> +. tests/nvme/rc
> +
> +requires() {
> + _nvme_requires
> +}
> +
> +DESCRIPTION="exercise the nvme metadata usage with passthrough commands"
> +QUICK=1
> +
> +test() {
This function name should be test_device() instead of test() to indicate that
it uses TEST_DEV. For test(), blktests provides empty TEST_DEV. So, actually
the src/nvme-passthrough-meta is not doing the test as expected.
> + echo "Running ${TEST_NAME}"
> +
> + src/nvme-passthrough-meta ${TEST_DEV}
I suggest to check status code of the command above, like:
if ! src/nvme-passthrough-meta ${TEST_DEV}; then
echo "src/nvme-passthrough-meta failed"
fi
This will catch the failure with empty TEST_DEV for test(). By renaming
test() to test_device(), src/nvme-passthrough-meta returns zero status.
Also, ${TEST_DEV} requires double quotations like "${TEST_DEV}", to suprress the
shellcheck WARN below:
$ make check
shellcheck -x -e SC2119 -f gcc check common/* \
tests/*/rc tests/*/[0-9]*[0-9] src/*.sh
tests/nvme/064:19:28: note: Double quote to prevent globbing and word splitting. [SC2086]
make: *** [Makefile:21: check] Error 1
More information about the Linux-nvme
mailing list