]> xenbits.xensource.com Git - libvirt.git/commit
storage: use f_frsize, not f_bsize, for calculating available space
authorSage Weil <sage@newdream.net>
Fri, 22 Feb 2013 23:43:00 +0000 (15:43 -0800)
committerEric Blake <eblake@redhat.com>
Sat, 23 Feb 2013 00:01:25 +0000 (17:01 -0700)
commitc2092abfb9110369633d2e229ad78d4445af86df
tree023cf1747b543bdd2637ba724438f551377428a8
parent91ffb42c2cdaa110eea58db1da477bd58d592c6a
storage: use f_frsize, not f_bsize, for calculating available space

The bfree and blocks fields are supposed to be in units of frsize.  We were
calculating capacity correctly using those units, but the available
calculation was using bsize instead.  Most file systems report these as the
same value specifically because many programs are buggy, but that is no
reason to rely on that behavior, or to behave inconsistently.

This bug has been present since e266ded (2008) and aa296e6c, when the code
was originally introduced (the latter via cut and paste).

Signed-off-by: Sage Weil <sage@newdream.net>
src/parallels/parallels_storage.c
src/storage/storage_backend_fs.c