diff options
author | Yuri Pankov <yuri.pankov@nexenta.com> | 2018-04-08 18:40:08 +0300 |
---|---|---|
committer | Richard Lowe <richlowe@richlowe.net> | 2018-04-24 17:22:40 +0000 |
commit | bf8c808aff646a7e2006c1a6fe7bcd596ce78105 (patch) | |
tree | 4d39d89826ccd51c7a9282c650c541acdba4eff8 | |
parent | df23f1c1c0a6fa2a4bddd7a14cfc75933bbd5917 (diff) | |
download | illumos-joyent-bf8c808aff646a7e2006c1a6fe7bcd596ce78105.tar.gz |
9285 nvme: "programming error: invalid NS/format" doing 'nvmeadm list' on a controller without namespaces
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r-- | usr/src/uts/common/io/nvme/nvme.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/usr/src/uts/common/io/nvme/nvme.c b/usr/src/uts/common/io/nvme/nvme.c index dded3186da..c6785b28d3 100644 --- a/usr/src/uts/common/io/nvme/nvme.c +++ b/usr/src/uts/common/io/nvme/nvme.c @@ -2554,6 +2554,13 @@ nvme_init(nvme_t *nvme) * Identify Namespaces */ nvme->n_namespace_count = nvme->n_idctl->id_nn; + + if (nvme->n_namespace_count == 0) { + dev_err(nvme->n_dip, CE_WARN, + "!controllers without namespaces are not supported"); + goto fail; + } + if (nvme->n_namespace_count > NVME_MINOR_MAX) { dev_err(nvme->n_dip, CE_WARN, "!too many namespaces: %d, limiting to %d\n", |