[PATCH] mdadm: fix --detail for cases where device count > max_devices/2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mdadm misreports (less devices then there are, and as a result decides the array is degraded) in cases where there are > max_devices/2 devices.

This seems to fix it.

---
Detail.c |    4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Detail.c b/Detail.c
index c4fcad9..62e5867 100644
--- a/Detail.c
+++ b/Detail.c
@@ -72,7 +72,7 @@ int Detail(char *dev, struct context *c)
	int failed = 0;
	struct supertype *st;
	char *subarray = NULL;
-	int max_disks = MD_SB_DISKS; /* just a default */
+	int max_disks = MD_SB_DISKS * 2; /* just a default */
	struct mdinfo *info = NULL;
	struct mdinfo *sra;
	struct mdinfo *subdev;
@@ -124,7 +124,7 @@ int Detail(char *dev, struct context *c)
	rv = 0;

	if (st)
-		max_disks = st->max_devs;
+		max_disks = st->max_devs * 2;

	if (subarray) {
		/* This is a subarray of some container.
-- 
1.7.9.5


--

Or Sagi | Chief System Architect
Reduxio Systems--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux