]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
client: use 4MB f_bsize and f_frsize for statfs
authorSage Weil <sage@inktank.com>
Fri, 22 Feb 2013 23:15:27 +0000 (15:15 -0800)
committerSage Weil <sage@inktank.com>
Fri, 22 Feb 2013 23:15:31 +0000 (15:15 -0800)
commit7c94083643891c9d66a117352f312b268bdb1135
treedbe393c3587feb35bdfbc8bdd155b6c2841b5e59
parent64267eb3d8cecac4f447d9545a55741bade0292e
client: use 4MB f_bsize and f_frsize for statfs

Old stat(1) reports:

  Block size: 1048576    Fundamental block size: 1048576

and the df(1) arithmetic works out.  New stat(1) reports:

  Block size: 1048576    Fundamental block size: 4096

which is what we are shoving into statvfs, but we have the b_size and
fr_size arithmetic swapped.  However, doing the *correct* reporting would
then break the old stat by making both sizes appear to be 4KB (or
whatever).

Sidestep the issue by making *both* values 4MB.. which is both large enough
to report large FS sizes, and also the default stripe size and thus a
"reasonable" value to report for a block size.

Perhaps in the future, when we no longer care about old userland, we can
report the page size for f_bsize, which is probably the "most correct"
thing to do.

Fixes: #3794. See also #3793.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/client/Client.cc