krishnanadh / rpms / rasdaemon

Forked from rpms/rasdaemon a year ago
Clone
Blob Blame History Raw
commit 5d00690583860313916825ce891a7b0d8005a0f9
Author: Cong Wang <xiyou.wangcong@gmail.com>
Date:   Fri Feb 28 12:37:15 2020 -0800

    Match rankX in ras-mc-ctl
    
    According to kernel doc:
    https://www.kernel.org/doc/html/v4.10/admin-guide/ras.html
    mcX directory contains either dimmX or rankX directories.
    
    Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in
index 54ab180..ff38143 100755
--- a/util/ras-mc-ctl.in
+++ b/util/ras-mc-ctl.in
@@ -247,7 +247,7 @@ sub parse_dimm_nodes
         $mc =~ s,.*mc(\d+).*,$1,;
 
         my $dimm = $file;
-        $dimm =~ s,.*dimm(\d+).*,$1,;
+        $dimm =~ s,.*(rank|dimm)(\d+).*,$2,;
 
         open IN, $file;
         my $location = <IN>;