smartmontools: fix 6.6 -> 7.0 NVMe SMART data readout regression. Bump.

This commit is contained in:
tnn 2019-01-18 02:04:43 +00:00
parent 75b1230c12
commit 0850a1e75e
3 changed files with 41 additions and 2 deletions

View file

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.33 2019/01/18 00:28:24 tnn Exp $
# $NetBSD: Makefile,v 1.34 2019/01/18 02:04:43 tnn Exp $
DISTNAME= smartmontools-7.0
PKGREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=smartmontools/}
@ -31,4 +32,7 @@ INSTALL_MAKE_FLAGS= ${MAKE_FLAGS} sysconfdir=${EGDIR}
INSTALLATION_DIRS= ${EGDIR}
CFLAGS+=-O0 -ggdb -g3
CXXFLAGS+=-O0 -ggdb -g3
.include "../../mk/bsd.pkg.mk"

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.32 2019/01/18 00:28:24 tnn Exp $
$NetBSD: distinfo,v 1.33 2019/01/18 02:04:43 tnn Exp $
SHA1 (smartmontools-7.0.tar.gz) = 00e6a7bb26b283695ab0deaf521be6723ba44f0a
RMD160 (smartmontools-7.0.tar.gz) = db20533115aa05a52836dbef0006c664083fbe90
@ -6,3 +6,4 @@ SHA512 (smartmontools-7.0.tar.gz) = 96e18a201182579f699d541539ce393e7bc2191e027c
Size (smartmontools-7.0.tar.gz) = 944925 bytes
SHA1 (patch-aa) = bd08aff267f0e9e9307ebc57858e61e35144bf16
SHA1 (patch-ag) = 01b0b35d89d6d6a11b13b3c05a141c46a0c1590b
SHA1 (patch-nvmecmds.cpp) = 0fec043f00b4a7fde2974e1a4670ce42343f2d52

View file

@ -0,0 +1,34 @@
$NetBSD: patch-nvmecmds.cpp,v 1.1 2019/01/18 02:04:43 tnn Exp $
It looks from the code like it is supposed to work to read the SMART data
by calling the nvme passthrough ioctl with broadcast nsid.
But it doesn't seem to work on NetBSD? So use the explicit nsid instead.
--- nvmecmds.cpp.orig 2018-08-19 18:45:53.000000000 +0000
+++ nvmecmds.cpp
@@ -207,7 +207,11 @@ bool nvme_read_log_page(nvme_device * de
// Read NVMe Error Information Log.
bool nvme_read_error_log(nvme_device * device, nvme_error_log_page * error_log, unsigned num_entries)
{
- if (!nvme_read_log_page(device, 0x01, error_log, num_entries * sizeof(*error_log), true))
+ bool use_broadcast_nsid = true;
+#if defined(__NetBSD__)
+ use_broadcast_nsid = false;
+#endif
+ if (!nvme_read_log_page(device, 0x01, error_log, num_entries * sizeof(*error_log), use_broadcast_nsid))
return false;
if (isbigendian()) {
@@ -228,7 +232,11 @@ bool nvme_read_error_log(nvme_device * d
// Read NVMe SMART/Health Information log.
bool nvme_read_smart_log(nvme_device * device, nvme_smart_log & smart_log)
{
- if (!nvme_read_log_page(device, 0x02, &smart_log, sizeof(smart_log), true))
+ bool use_broadcast_nsid = true;
+#if defined(__NetBSD__)
+ use_broadcast_nsid = false;
+#endif
+ if (!nvme_read_log_page(device, 0x02, &smart_log, sizeof(smart_log), use_broadcast_nsid))
return false;
if (isbigendian()) {