]>
git.ipfire.org Git - thirdparty/mdadm.git/commit - util.c
util: remove rounding error where reporting "human sizes".
The division
1<<20 / 200
is not exact, so dividing by this to convert bytes into half-megs
is wrong and results in incorrect output.
As we are doing "long long" arithmetic, there is no risk of an overflow
until we reach 64 petabytes.
So change to
* 200 / (1<<20).
Reported-by: Jan Echternach <jan@goneko.de>
Resolved-debian-bug: 763917
URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=763917
Signed-off-by: NeilBrown <neilb@suse.de>