[PATCH blktests] nvme: test log page offsets

Keith Busch kbusch at meta.com
Mon Feb 5 10:52:25 PST 2024


From: Keith Busch <kbusch at kernel.org>

I've encountered a device that fails catastrophically if the host
requests to an error log with a non-zero LPO. The fallout has been bad
enough to warrant a sanity check against this scenario.

Signed-off-by: Keith Busch <kbusch at kernel.org>
---
 tests/nvme/051     | 26 ++++++++++++++++++++++++++
 tests/nvme/051.out |  2 ++
 2 files changed, 28 insertions(+)
 create mode 100755 tests/nvme/051
 create mode 100644 tests/nvme/051.out

diff --git a/tests/nvme/051 b/tests/nvme/051
new file mode 100755
index 0000000..ef30ad8
--- /dev/null
+++ b/tests/nvme/051
@@ -0,0 +1,26 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2024 Keith Busch
+
+. tests/nvme/rc
+
+DESCRIPTION="Tests device support for log page offsets"
+CAN_BE_ZONED=1
+QUICK=1
+
+requires() {
+	_nvme_requires
+}
+
+test_device() {
+	echo "Running ${TEST_NAME}"
+
+	lpa=$(sudo nvme id-ctrl "${TEST_DEV}"  | grep lpa | cut -d":" -f 2 | xargs)
+	lpo=$((lpa & 0x4))
+
+	if [ $lpo -ne 0 ]; then
+		nvme get-log "${TEST_DEV}" --log-id=1 --log-len=128 --lpo=0x1000 > /dev/NULL
+	fi
+
+	echo "Test complete"
+}
diff --git a/tests/nvme/051.out b/tests/nvme/051.out
new file mode 100644
index 0000000..156f068
--- /dev/null
+++ b/tests/nvme/051.out
@@ -0,0 +1,2 @@
+Running nvme/051
+Test complete
-- 
2.34.1




More information about the Linux-nvme mailing list