diff options
author | Neil Brown <neilb@suse.de> | 2008-04-28 16:29:37 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2008-04-28 16:29:37 +1000 |
commit | 7a3be72fc621b4a7589e923cf0652c51493f831a (patch) | |
tree | c2e88676f5be4205eab54fe9b71c43ec442b0ffd /Detail.c | |
parent | 2cdb64897d4fe33a11af13c6356dcd338c561e77 (diff) | |
download | mdadm-7a3be72fc621b4a7589e923cf0652c51493f831a.tar.gz |
Fix problems with array.size overflowing on large arrays.
array.size is 32bits and counts K. So for arrays with
more than 4Terrabytes, it can overflow.
The correct number can be read from sysfs, but there are still
a few places that use array.size and risk truncation. What is worse.
they compare a number of kilobytes with a number of sectors !!
So use get_component_size() to read the sysfs information, and be
more consistent about units.
Diffstat (limited to 'Detail.c')
-rw-r--r-- | Detail.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -191,7 +191,7 @@ int Detail(char *dev, int brief, int export, int test, char *homehost) if (dsize > 0) printf(" Used Dev Size : %llu%s\n", dsize, - human_size((long long)array.size<<10)); + human_size((long long)dsize<<10)); else printf(" Used Dev Size : unknown\n"); } else |