summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Rosenfeld <hans.rosenfeld@joyent.com>2017-07-20 17:19:34 +0200
committerHans Rosenfeld <hans.rosenfeld@joyent.com>2017-09-12 16:59:24 +0200
commit1e167260e7cd91e04759854b0ae61b36cd47a218 (patch)
treee798ba1e3814c8670a603adb177096f16d948937
parentc6e58d8c85cf3e5d0db157501b40276eb59edf16 (diff)
downloadillumos-joyent-1e167260e7cd91e04759854b0ae61b36cd47a218.tar.gz
8480 nvmeadm should ignore 0-sized namespaces by default
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/cmd/nvmeadm/nvmeadm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/usr/src/cmd/nvmeadm/nvmeadm.c b/usr/src/cmd/nvmeadm/nvmeadm.c
index d7dffc1d47..de1d3e0171 100644
--- a/usr/src/cmd/nvmeadm/nvmeadm.c
+++ b/usr/src/cmd/nvmeadm/nvmeadm.c
@@ -528,6 +528,15 @@ static int
do_list_nsid(int fd, const nvme_process_arg_t *npa)
{
_NOTE(ARGUNUSED(fd));
+ const uint_t format = npa->npa_idns->id_flbas.lba_format;
+ const uint_t bshift = npa->npa_idns->id_lbaf[format].lbaf_lbads;
+
+ /*
+ * Some devices have extra namespaces with illegal block sizes and
+ * zero blocks. Don't list them when verbose operation isn't requested.
+ */
+ if ((bshift < 9 || npa->npa_idns->id_nsize == 0) && verbose == 0)
+ return (0);
(void) printf(" %s/%s (%s): ", npa->npa_name,
di_minor_name(npa->npa_minor),