From 6ee5c05a11a7c5160178e6eb21a30d294f56f235 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 30 Jan 2006 23:42:53 +0000 Subject: Report device size correctly in --detail for Large devices. Signed-off-by: Neil Brown --- Detail.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Detail.c') diff --git a/Detail.c b/Detail.c index 704fffe..2986a6e 100644 --- a/Detail.c +++ b/Detail.c @@ -166,9 +166,13 @@ int Detail(char *dev, int brief, int test) printf(" Array Size : %llu%s\n", (larray_size>>10), human_size(larray_size)); if (array.level >= 1) { if (array.major_version != 0 && - larray_size >= 0xFFFFFFFFULL) - printf(" Device Size : unknown\n"); - else + (larray_size >= 0xFFFFFFFFULL|| array.size == 0)) { + unsigned long long dsize = get_component_size(fd); + if (dsize > 0) + printf(" Device Size : %llu%s\n", dsize, human_size((long long)array.size<<10)); + else + printf(" Device Size : unknown\n"); + } else printf(" Device Size : %d%s\n", array.size, human_size((long long)array.size<<10)); } printf(" Raid Devices : %d\n", array.raid_disks); -- cgit