dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0021-add-missing-units-to-examine.patch

5d5466
From 227aeaa872d4898273cf87a4253898823d556c43 Mon Sep 17 00:00:00 2001
5d5466
From: Corey Hickey <bugfood-c@fatooh.org>
5d5466
Date: Mon, 11 Feb 2019 17:42:27 -0800
5d5466
Subject: [RHEL7.7 PATCH 21/24] add missing units to --examine
5d5466
5d5466
Within the output of "mdadm --examine", there are three sizes reported
5d5466
on adjacent lines. For example:
5d5466
5d5466
$ sudo mdadm --examine /dev/md3
5d5466
[...]
5d5466
 Avail Dev Size : 17580545024 (8383.06 GiB 9001.24 GB)
5d5466
     Array Size : 17580417024 (16765.99 GiB 18002.35 GB)
5d5466
  Used Dev Size : 11720278016 (5588.66 GiB 6000.78 GB)
5d5466
[...]
5d5466
5d5466
This can be confusing, since the first and third line are in 512-byte
5d5466
sectors, and the second is in KiB.
5d5466
5d5466
Add units to avoid ambiguity.
5d5466
5d5466
(I don't particularly like the "KiB" notation, but it is at least
5d5466
unambiguous.)
5d5466
5d5466
Signed-off-by: Corey Hickey <bugfood-c@fatooh.org>
5d5466
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
5d5466
---
5d5466
 super1.c | 6 +++---
5d5466
 1 file changed, 3 insertions(+), 3 deletions(-)
5d5466
5d5466
diff --git a/super1.c b/super1.c
5d5466
index 636a286..b85dc20 100644
5d5466
--- a/super1.c
5d5466
+++ b/super1.c
5d5466
@@ -360,7 +360,7 @@ static void examine_super1(struct supertype *st, char *homehost)
5d5466
 	printf("     Raid Level : %s\n", c?c:"-unknown-");
5d5466
 	printf("   Raid Devices : %d\n", __le32_to_cpu(sb->raid_disks));
5d5466
 	printf("\n");
5d5466
-	printf(" Avail Dev Size : %llu%s\n",
5d5466
+	printf(" Avail Dev Size : %llu sectors%s\n",
5d5466
 	       (unsigned long long)__le64_to_cpu(sb->data_size),
5d5466
 	       human_size(__le64_to_cpu(sb->data_size)<<9));
5d5466
 	if (__le32_to_cpu(sb->level) > 0) {
5d5466
@@ -378,11 +378,11 @@ static void examine_super1(struct supertype *st, char *homehost)
5d5466
 		if (ddsks) {
5d5466
 			long long asize = __le64_to_cpu(sb->size);
5d5466
 			asize = (asize << 9) * ddsks / ddsks_denom;
5d5466
-			printf("     Array Size : %llu%s\n",
5d5466
+			printf("     Array Size : %llu KiB%s\n",
5d5466
 			       asize >> 10,  human_size(asize));
5d5466
 		}
5d5466
 		if (sb->size != sb->data_size)
5d5466
-			printf("  Used Dev Size : %llu%s\n",
5d5466
+			printf("  Used Dev Size : %llu sectors%s\n",
5d5466
 			       (unsigned long long)__le64_to_cpu(sb->size),
5d5466
 			       human_size(__le64_to_cpu(sb->size)<<9));
5d5466
 	}
5d5466
-- 
5d5466
2.7.5
5d5466