Skip to content
Snippets Groups Projects
Commit 2fb0b151 authored by chrfranke's avatar chrfranke
Browse files

nvmeprint.cpp: Fix self-test for single namespace devices.

Use broadcast NSID if only one namespace is supported
(#1741, GH issues/217).
smartctl.8.in: Document new behavior.

git-svn-id: https://svn.code.sf.net/p/smartmontools/code/trunk@5603 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent eaba08b7
Branches
No related tags found
No related merge requests found
$Id$ $Id$
2024-03-29 Christian Franke <franke@computer.org>
nvmeprint.cpp: Fix self-test for single namespace devices.
Use broadcast NSID if only one namespace is supported
(#1741, GH issues/217).
smartctl.8.in: Document new behavior.
2024-03-28 Christian Franke <franke@computer.org> 2024-03-28 Christian Franke <franke@computer.org>
drivedb.h: drivedb.h:
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Home page of code is: https://www.smartmontools.org * Home page of code is: https://www.smartmontools.org
* *
* Copyright (C) 2016-23 Christian Franke * Copyright (C) 2016-24 Christian Franke
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
*/ */
...@@ -751,7 +751,12 @@ int nvmePrintMain(nvme_device * device, const nvme_print_options & options) ...@@ -751,7 +751,12 @@ int nvmePrintMain(nvme_device * device, const nvme_print_options & options)
// Check for self-test support // Check for self-test support
bool self_test_sup = !!(id_ctrl.oacs & 0x0010); bool self_test_sup = !!(id_ctrl.oacs & 0x0010);
unsigned self_test_nsid = device->get_nsid(); // TODO: Support NSID=0 to test controller
// Use broadcast NSID for self-tests if only one namespace is supported.
// Some single namespace devices return failure if NSID=1 is used to
// address self-tests.
// TODO: Support NSID=0 to test controller
unsigned self_test_nsid = (id_ctrl.nn == 1 ? 0xffffffff : device->get_nsid());
// Read and print Self-test log, check for running test // Read and print Self-test log, check for running test
int self_test_completion = -1; int self_test_completion = -1;
......
.ig .ig
Copyright (C) 2002-10 Bruce Allen Copyright (C) 2002-10 Bruce Allen
Copyright (C) 2004-23 Christian Franke Copyright (C) 2004-24 Christian Franke
SPDX-License-Identifier: GPL-2.0-or-later SPDX-License-Identifier: GPL-2.0-or-later
...@@ -1477,6 +1477,13 @@ test terminology). ...@@ -1477,6 +1477,13 @@ test terminology).
.I selftest .I selftest
\- [NVMe: NEW EXPERIMENTAL SMARTCTL 7.4 FEATURE] \- [NVMe: NEW EXPERIMENTAL SMARTCTL 7.4 FEATURE]
prints the NVMe self-test log. prints the NVMe self-test log.
.br
[NEW EXPERIMENTAL SMARTCTL 7.5 FEATURE]
If the device does not support multiple namespaces, the broadcast namespace
is always used to read the self-test log and to start the tests (see
\*(Aq\-t TEST\*(Aq below).
This is because some single namespace devices return failure if namespace 1
is used to address self-tests.
.\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin .\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin
.Sp .Sp
.I xselftest[,NUM][,selftest] .I xselftest[,NUM][,selftest]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment