dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/Monitor-check_array-declate-mdinfo-instance-globally.patch

2c1b57
From 826522f0dc86d31cc7207b01957b5c4243f49dc8 Mon Sep 17 00:00:00 2001
2c1b57
From: Jes Sorensen <jsorensen@fb.com>
2c1b57
Date: Tue, 9 May 2017 16:41:06 -0400
2c1b57
Subject: [RHEL7.5 PATCH 127/169] Monitor/check_array: Declate mdinfo
2c1b57
 instance globally
2c1b57
2c1b57
We can pull in more information from sysfs earlier, so move sra to the top.
2c1b57
2c1b57
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2c1b57
---
2c1b57
 Monitor.c | 4 ++--
2c1b57
 1 file changed, 2 insertions(+), 2 deletions(-)
2c1b57
2c1b57
diff --git a/Monitor.c b/Monitor.c
2c1b57
index c519877..bb3a2c4 100644
2c1b57
--- a/Monitor.c
2c1b57
+++ b/Monitor.c
2c1b57
@@ -451,6 +451,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
2c1b57
 	 * '1' if the array is degraded, or '0' if it is optimal (or dead).
2c1b57
 	 */
2c1b57
 	struct { int state, major, minor; } info[MAX_DISKS];
2c1b57
+	struct mdinfo *sra;
2c1b57
 	mdu_array_info_t array;
2c1b57
 	struct mdstat_ent *mse = NULL, *mse2;
2c1b57
 	char *dev = st->devname;
2c1b57
@@ -556,8 +557,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
2c1b57
 		 * If there is a number in /mismatch_cnt,
2c1b57
 		 * we should report that.
2c1b57
 		 */
2c1b57
-		struct mdinfo *sra =
2c1b57
-			sysfs_read(-1, st->devnm, GET_MISMATCH);
2c1b57
+		sra = sysfs_read(-1, st->devnm, GET_MISMATCH);
2c1b57
 		if (sra && sra->mismatch_cnt > 0) {
2c1b57
 			char cnt[80];
2c1b57
 			snprintf(cnt, sizeof(cnt),
2c1b57
-- 
2c1b57
2.7.4
2c1b57