From fe3cf26889c8ccf42a445b183a9a304fb8905bac Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Wed, 21 Nov 2018 19:09:53 -0800 Subject: [PATCH] Try underlying NVME device first --- smart-status/smart-status-lib.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/smart-status/smart-status-lib.pl b/smart-status/smart-status-lib.pl index 92af357e2..4b157f90a 100755 --- a/smart-status/smart-status-lib.pl +++ b/smart-status/smart-status-lib.pl @@ -279,6 +279,12 @@ Returns a hash reference containing the status of some drive sub get_drive_status { local ($device, $drive) = @_; +if ($device =~ /^(\/dev\/nvme\d+)n\d+$/) { + # For NVME drives, try the underlying device first + local $nd = $1; + local $st = &get_drive_status($nd, $drive); + return $st if ($st->{'support'} && $st->{'enabled'}); + } local %rv; local $qd = quotemeta($device); local $extra_args = &get_extra_args($device, $drive);