summaryrefslogtreecommitdiffstats
path: root/Detail.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-02-02 10:03:20 +1100
committerNeilBrown <neilb@suse.de>2009-02-02 10:03:20 +1100
commita1236192111a8425e6c6d81c44103e9f4a2f465c (patch)
treec7adf978c8f0f620c0a971fab741e5ba9ee24b98 /Detail.c
parent2df1f269113c687e0c23fad2ca9bcf3c4dcbb382 (diff)
downloadmdadm-a1236192111a8425e6c6d81c44103e9f4a2f465c.tar.gz
mdadm-a1236192111a8425e6c6d81c44103e9f4a2f465c.tar.xz
mdadm-a1236192111a8425e6c6d81c44103e9f4a2f465c.zip
Fix the used device size in mdadm -D output.
As get_component_size() returns the number of used sectors of a device we need halve before pringing as K, and shift the value by 9, not 10, before passing to human_size. Thanks to Andre Noll <maan@systemlinux.org> for identifying problem (and a slightly different version of this patch) Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Detail.c')
-rw-r--r--Detail.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Detail.c b/Detail.c
index 3cee66f..8f86ead 100644
--- a/Detail.c
+++ b/Detail.c
@@ -198,8 +198,8 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
unsigned long long dsize = get_component_size(fd);
if (dsize > 0)
printf(" Used Dev Size : %llu%s\n",
- dsize,
- human_size((long long)dsize<<10));
+ dsize/2,
+ human_size((long long)dsize<<9));
else
printf(" Used Dev Size : unknown\n");
} else