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