]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
super0: Fix reporting of devices between 2GB and 4GB
authorNeilBrown <neilb@suse.com>
Thu, 28 Jan 2016 00:57:54 +0000 (11:57 +1100)
committerNeilBrown <neilb@suse.com>
Thu, 28 Jan 2016 00:57:54 +0000 (11:57 +1100)
v0.90 metadata can handle devices between 2GB and 4GB, but we need
to treat the 'size' and unsigned.  In a couple of places we don't.

URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809447
Signed-off-by: NeilBrown <neilb@suse.com>
Detail.c
super0.c

index d0292191777dd5b7acac6e362b91565013b8db55..0cfccadb4fb85ff6a4ae8b5c6fbd7dde59397797 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -425,8 +425,9 @@ int Detail(char *dev, struct context *c)
                                else
                                        printf("  Used Dev Size : unknown\n");
                        } else
-                               printf("  Used Dev Size : %d%s\n", array.size,
-                                      human_size((long long)array.size<<10));
+                               printf("  Used Dev Size : %lu%s\n",
+                                      (unsigned long)array.size,
+                                      human_size((unsigned long long)array.size<<10));
                }
                if (array.raid_disks)
                        printf("   Raid Devices : %d\n", array.raid_disks);
index 7f8001479edc0f58a32adaf128c132c6dfb69a77..59a6a034fb6a2ba5bd442e771b357fc7ce1085f8 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -405,7 +405,8 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info, char *map)
        info->array.utime = sb->utime;
        info->array.chunk_size = sb->chunk_size;
        info->array.state = sb->state;
-       info->component_size = sb->size*2;
+       info->component_size = sb->size;
+       info->component_size *= 2;
 
        if (sb->state & (1<<MD_SB_BITMAP_PRESENT))
                info->bitmap_offset = 8;