From: Björn Jacke Date: Tue, 8 Jan 2019 09:38:06 +0000 (+0100) Subject: statvfs: fix bsize and frsize mixup X-Git-Tag: talloc-2.1.15~214 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7d3ee18a5979168b6cab42d692eb39fa5d44154;p=thirdparty%2Fsamba.git statvfs: fix bsize and frsize mixup 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 Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Thu Jan 10 09:40:06 CET 2019 on sn-devel-144 --- diff --git a/source3/smbd/statvfs.c b/source3/smbd/statvfs.c index d4bdf1629f2..2312d2c8240 100644 --- a/source3/smbd/statvfs.c +++ b/source3/smbd/statvfs.c @@ -123,8 +123,10 @@ static int linux_statvfs(const char *path, vfs_statvfs_struct *statbuf) 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;