[PATCH blktests] nvme/{033,036,037}: skip when the test target namespace has metadata

Shin'ichiro Kawasaki shinichiro.kawasaki at wdc.com
Tue Jun 30 04:37:14 PDT 2026


The kernel commit c8cdecdb47d3 ("nvme: core: reject invalid LBA data
size from Identify Namespace") in the v7.2-rc1 tag triggered failures of
blktests test cases nvme/033, 036 and 037. The failures are observed
when TEST_DEV specifies a NVMe device with metadata. The commit
introduced a new check in nvme_update_ns_info_block() to reject invalid
LBA data size. After this commit, namespaces with zero LBA data size are
rejected.

According to the comment in nvmet_passthru_override_id_ns() in the
kernel code drivers/nvme/target/passthru.c, "Presently the NVMEoF target
code does not support sending metadata, so we must disable it here". For
that purpose, the function sets the LBA data size to zero for all LBA
format (lbaf) entries with metadata. After the trigger commit, these
entries become invalid for NVMEoF target passthru, then namespaces with
metadata are not visible as block devices through the target setup.

These test cases set up NVMEoF target passthru assuming the namespace
devices are visible, so they cannot find the namespaces and fail.

To avoid the failures, skip the test cases when TEST_DEV has metadata.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki at wdc.com>
---
 tests/nvme/033 | 1 +
 tests/nvme/036 | 1 +
 tests/nvme/037 | 1 +
 3 files changed, 3 insertions(+)

diff --git a/tests/nvme/033 b/tests/nvme/033
index d0581c2..5bb1f45 100755
--- a/tests/nvme/033
+++ b/tests/nvme/033
@@ -15,6 +15,7 @@ requires() {
 
 device_requires() {
 	_require_test_dev_is_not_nvme_multipath
+	_test_dev_has_no_metadata
 }
 
 set_conditions() {
diff --git a/tests/nvme/036 b/tests/nvme/036
index 11cd5c1..9e6249f 100755
--- a/tests/nvme/036
+++ b/tests/nvme/036
@@ -15,6 +15,7 @@ requires() {
 
 device_requires() {
 	_require_test_dev_is_not_nvme_multipath
+	_test_dev_has_no_metadata
 }
 
 set_conditions() {
diff --git a/tests/nvme/037 b/tests/nvme/037
index 33a6857..24c895a 100755
--- a/tests/nvme/037
+++ b/tests/nvme/037
@@ -14,6 +14,7 @@ requires() {
 
 device_requires() {
 	_require_test_dev_is_not_nvme_multipath
+	_test_dev_has_no_metadata
 }
 
 set_conditions() {
-- 
2.54.0




More information about the Linux-nvme mailing list