dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/Detail-Remove-pre-2.6-code-for-printing-info-on-rebu.patch

2c1b57
From 5e13ef714df4734c455b5e4389352c8ab7902038 Mon Sep 17 00:00:00 2001
2c1b57
From: Jes Sorensen <jsorensen@fb.com>
2c1b57
Date: Wed, 12 Apr 2017 14:48:10 -0400
2c1b57
Subject: [RHEL7.5 PATCH 076/169] Detail: Remove pre-2.6 code for printing
2c1b57
 info on rebuilding
2c1b57
2c1b57
Since we no longer support anything pre-2.6.15, there is no point in
2c1b57
keeping this around.
2c1b57
2c1b57
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2c1b57
---
2c1b57
 Detail.c | 19 +++----------------
2c1b57
 1 file changed, 3 insertions(+), 16 deletions(-)
2c1b57
2c1b57
diff --git a/Detail.c b/Detail.c
2c1b57
index d4e6204..8f74832 100644
2c1b57
--- a/Detail.c
2c1b57
+++ b/Detail.c
2c1b57
@@ -64,8 +64,6 @@ int Detail(char *dev, struct context *c)
2c1b57
 	int max_devices = 0, n_devices = 0;
2c1b57
 	int spares = 0;
2c1b57
 	struct stat stb;
2c1b57
-	int is_26 = get_linux_version() >= 2006000;
2c1b57
-	int is_rebuilding = 0;
2c1b57
 	int failed = 0;
2c1b57
 	struct supertype *st;
2c1b57
 	char *subarray = NULL;
2c1b57
@@ -527,7 +525,6 @@ int Detail(char *dev, struct context *c)
2c1b57
 				"Reshape", "Check"};
2c1b57
 			printf("    %7s Status : %d%% complete\n",
2c1b57
 			       sync_action[e->resync], e->percent);
2c1b57
-			is_rebuilding = 1;
2c1b57
 		}
2c1b57
 		free_mdstat(ms);
2c1b57
 
2c1b57
@@ -676,19 +673,9 @@ This is pretty boring
2c1b57
 			      |(1<
2c1b57
 			    == 0) {
2c1b57
 				printf(" spare");
2c1b57
-				if (is_26) {
2c1b57
-					if (disk.raid_disk < array.raid_disks && disk.raid_disk >= 0)
2c1b57
-						printf(" rebuilding");
2c1b57
-				} else if (is_rebuilding && failed) {
2c1b57
-					/* Taking a bit of a risk here, we remove the
2c1b57
-					 * device from the array, and then put it back.
2c1b57
-					 * If this fails, we are rebuilding
2c1b57
-					 */
2c1b57
-					int err = ioctl(fd, HOT_REMOVE_DISK, makedev(disk.major, disk.minor));
2c1b57
-					if (err == 0) ioctl(fd, HOT_ADD_DISK, makedev(disk.major, disk.minor));
2c1b57
-					if (err && errno ==  EBUSY)
2c1b57
-						printf(" rebuilding");
2c1b57
-				}
2c1b57
+				if (disk.raid_disk < array.raid_disks &&
2c1b57
+				    disk.raid_disk >= 0)
2c1b57
+					printf(" rebuilding");
2c1b57
 			}
2c1b57
 		}
2c1b57
 		if (disk.state == 0) spares++;
2c1b57
-- 
2c1b57
2.7.4
2c1b57