dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/Detail-Reinstate-support-for-not-having-sysfs.patch

2c1b57
From 0885b942b3575c7f2a8290087751d83902587371 Mon Sep 17 00:00:00 2001
2c1b57
From: Jes Sorensen <jsorensen@fb.com>
2c1b57
Date: Tue, 25 Apr 2017 14:34:31 -0400
2c1b57
Subject: [RHEL7.5 PATCH 097/169] Detail: Reinstate support for not having
2c1b57
 sysfs
2c1b57
2c1b57
While sysfs support will hopefully go away eventually, lets not break
2c1b57
it unnecessarily for now.
2c1b57
2c1b57
Fixes: 901d5ee ("Detail: Stop bothering about md drivers older than 0.90.00")
2c1b57
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2c1b57
---
2c1b57
 Detail.c | 8 +++++---
2c1b57
 1 file changed, 5 insertions(+), 3 deletions(-)
2c1b57
2c1b57
diff --git a/Detail.c b/Detail.c
2c1b57
index ceb21b1..ef2370c 100644
2c1b57
--- a/Detail.c
2c1b57
+++ b/Detail.c
2c1b57
@@ -88,9 +88,11 @@ int Detail(char *dev, struct context *c)
2c1b57
 	}
2c1b57
 	sra = sysfs_read(fd, NULL, GET_VERSION | GET_DEVS | GET_ARRAY_STATE);
2c1b57
 	if (!sra) {
2c1b57
-		pr_err("%s does not appear to be an md device\n", dev);
2c1b57
-		close(fd);
2c1b57
-		return rv;
2c1b57
+		if (md_get_array_info(fd, &array)) {
2c1b57
+			pr_err("%s does not appear to be an md device\n", dev);
2c1b57
+			close(fd);
2c1b57
+			return rv;
2c1b57
+		}
2c1b57
 	}
2c1b57
 	external = (sra != NULL && sra->array.major_version == -1 &&
2c1b57
 		    sra->array.minor_version == -2);
2c1b57
-- 
2c1b57
2.7.4
2c1b57