the block size (the real one) is the "fundamental file system block size" and
that is the frsize struct member in the statvfs struct. The bsize struct member
of the statvfs struct is *different* from the same named one of the statfs
struct.
See also http://pubs.opengroup.org/onlinepubs/
9699919799/basedefs/sys_statvfs.h.html
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11810
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jan 10 09:40:06 CET 2019 on sn-devel-144
result = statvfs(path, &statvfs_buf);
if (!result) {
- statbuf->OptimalTransferSize = statvfs_buf.f_frsize;
- statbuf->BlockSize = statvfs_buf.f_bsize;
+ /* statvfs bsize is not the statfs bsize, the naming is terrible,
+ * see bug 11810 */
+ statbuf->OptimalTransferSize = statvfs_buf.f_bsize;
+ statbuf->BlockSize = statvfs_buf.f_frsize;
statbuf->TotalBlocks = statvfs_buf.f_blocks;
statbuf->BlocksAvail = statvfs_buf.f_bfree;
statbuf->UserBlocksAvail = statvfs_buf.f_bavail;