NeilBrown: Don't report Used Dev Size for RAID0.

Martin F. Krafft madduck at alioth.debian.org
Sat Aug 28 18:46:50 UTC 2010


Module: mdadm
Branch: master
Commit: c43f7d91cc15a1eb202e40e435623bf14dc2adb8
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=c43f7d91cc15a1eb202e40e435623bf14dc2adb8

Author: NeilBrown <neilb at suse.de>
Date:   Thu Jul 22 15:45:18 2010 +1000

Don't report Used Dev Size for RAID0.

This number isn't meaningful for RAID0 as a different amount of space
might be used from each device.
It isn't meaningful for linear either, but already was not reported
for linear.
Detail doesn't report it either.
So make --examine not report it.

Signed-off-by: NeilBrown <neilb at suse.de>
Reported-by: Mario 'BitKoenig' Holbe <Mario.Holbe at TU-Ilmenau.DE>

---

 super0.c |    2 +-
 super1.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/super0.c b/super0.c
index b8dfdb4..5db118c 100644
--- a/super0.c
+++ b/super0.c
@@ -113,7 +113,7 @@ static void examine_super0(struct supertype *st, char *homehost)
 	printf("  Creation Time : %.24s\n", ctime(&atime));
 	c=map_num(pers, sb->level);
 	printf("     Raid Level : %s\n", c?c:"-unknown-");
-	if ((int)sb->level >= 0) {
+	if ((int)sb->level > 0) {
 		int ddsks=0;
 		printf("  Used Dev Size : %d%s\n", sb->size,
 		       human_size((long long)sb->size<<10));
diff --git a/super1.c b/super1.c
index 216690d..dc2021f 100644
--- a/super1.c
+++ b/super1.c
@@ -239,7 +239,7 @@ static void examine_super1(struct supertype *st, char *homehost)
 	printf(" Avail Dev Size : %llu%s\n",
 	       (unsigned long long)__le64_to_cpu(sb->data_size),
 	       human_size(__le64_to_cpu(sb->data_size)<<9));
-	if (__le32_to_cpu(sb->level) >= 0) {
+	if (__le32_to_cpu(sb->level) > 0) {
 		int ddsks=0;
 		switch(__le32_to_cpu(sb->level)) {
 		case 1: ddsks=1;break;




More information about the pkg-mdadm-commits mailing list