From 850d8166500a0320c8672df0a631199a3b80f339 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Mon, 27 Jul 2015 15:34:02 +0000 Subject: [PATCH] MFC r285796: nvmecontrol: read controller identify data before any log page operations Sponsored by: Intel --- sbin/nvmecontrol/logpage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/logpage.c b/sbin/nvmecontrol/logpage.c index e3309885e39f..ac443bbe15b1 100644 --- a/sbin/nvmecontrol/logpage.c +++ b/sbin/nvmecontrol/logpage.c @@ -298,6 +298,8 @@ logpage(int argc, char *argv[]) open_dev(argv[optind], &fd, 1, 1); } + read_controller_data(fd, &cdata); + /* * The log page attribtues indicate whether or not the controller * supports the SMART/Health information log page on a per @@ -307,7 +309,6 @@ logpage(int argc, char *argv[]) if (log_page != NVME_LOG_HEALTH_INFORMATION) errx(1, "log page %d valid only at controller level", log_page); - read_controller_data(fd, &cdata); if (cdata.lpa.ns_smart == 0) errx(1, "controller does not support per namespace "