summaryrefslogtreecommitdiff
path: root/usr/src/uts/common
diff options
context:
space:
mode:
authorHans Rosenfeld <rosenfeld@grumpf.hope-2000.org>2022-04-01 11:54:32 +0200
committerHans Rosenfeld <rosenfeld@grumpf.hope-2000.org>2022-10-11 21:39:31 +0200
commit670f080b72593a4a43a509cd4a020ffe8a6484a6 (patch)
tree5ed41875ed647d214d9c36177d88a030ccede28d /usr/src/uts/common
parent2841912edb2f7c5e77ae94d2ff7fe17ad82f2fcd (diff)
downloadillumos-joyent-670f080b72593a4a43a509cd4a020ffe8a6484a6.tar.gz
14690 nvmeadm should refer to namespaces by their nsid
Reviewed by: Andrew Giles <agiles@tintri.com> Reviewed by: Guy Morrogh <gmorrogh@tintri.com> Reviewed by: Robert Mustacchi <rm@fingolfin.org> Approved by: Dan McDonald <danmcd@mnx.io>
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r--usr/src/uts/common/io/nvme/nvme.c20
-rw-r--r--usr/src/uts/common/io/nvme/nvme_var.h2
2 files changed, 7 insertions, 15 deletions
diff --git a/usr/src/uts/common/io/nvme/nvme.c b/usr/src/uts/common/io/nvme/nvme.c
index d76fa48d1b..2aa87600f4 100644
--- a/usr/src/uts/common/io/nvme/nvme.c
+++ b/usr/src/uts/common/io/nvme/nvme.c
@@ -2013,8 +2013,9 @@ nvme_async_event_task(void *arg)
break;
dev_err(nvme->n_dip, CE_NOTE,
- "!namespace %u (%s) has changed.", nsid,
- NVME_NSID2NS(nvme, nsid)->ns_name);
+ "!namespace nvme%d/%u has changed.",
+ ddi_get_instance(nvme->n_dip), nsid);
+
if (nvme_init_ns(nvme, nsid) != DDI_SUCCESS)
continue;
@@ -3016,19 +3017,10 @@ nvme_init_ns(nvme_t *nvme, int nsid)
bcopy(idns->id_nguid, ns->ns_nguid, sizeof (ns->ns_nguid));
/*LINTED: E_BAD_PTR_CAST_ALIGN*/
- if (*(uint64_t *)ns->ns_eui64 != 0) {
- uint8_t *eui64 = ns->ns_eui64;
-
- (void) snprintf(ns->ns_name, sizeof (ns->ns_name),
- "%02x%02x%02x%02x%02x%02x%02x%02x",
- eui64[0], eui64[1], eui64[2], eui64[3],
- eui64[4], eui64[5], eui64[6], eui64[7]);
- } else {
- (void) snprintf(ns->ns_name, sizeof (ns->ns_name), "%d",
- ns->ns_id);
-
+ if (*(uint64_t *)ns->ns_eui64 == 0)
nvme_prepare_devid(nvme, ns->ns_id);
- }
+
+ (void) snprintf(ns->ns_name, sizeof (ns->ns_name), "%u", ns->ns_id);
/*
* Find the LBA format with no metadata and the best relative
diff --git a/usr/src/uts/common/io/nvme/nvme_var.h b/usr/src/uts/common/io/nvme/nvme_var.h
index dde0af58fb..ca3e7ef1a4 100644
--- a/usr/src/uts/common/io/nvme/nvme_var.h
+++ b/usr/src/uts/common/io/nvme/nvme_var.h
@@ -279,7 +279,7 @@ struct nvme_namespace {
nvme_t *ns_nvme;
uint8_t ns_eui64[8];
uint8_t ns_nguid[16];
- char ns_name[17];
+ char ns_name[11];
bd_handle_t ns_bd_hdl;