mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
0bf981278e
On *NIX platforms the statfs(2) system call returns a struct containing both the free blocks in the filesystem (Statfs_t.Bfree) and the free blocks available to the unprivileged or non-superuser (Statfs_t.Bavail). The `Bfree` and `Bavail` fields (with `Bfree >= Bavail`) will be set to different values on e.g. filesystems such as ext4 that reserve a certain percentage of the filesystem blocks which may only be allocated by admnistrative privileged processes. The calculations for the `Total` disk space need to subtract the difference between the `Bfree` and `Bavail` fields for it to correctly show the total available storage space available for unprivileged users. This implicitly fixes a bug where the `Used = Total - Free` calculation yielded different (and also incorrect) results for identical contents stored when only the sizes of the disks or backing volumes differed. (as can be witnessed in the `Used:` value displayed in the Minio browser) See: - https://wiki.archlinux.org/index.php/ext4#Reserved_blocks - http://man7.org/linux/man-pages/man2/statfs.2.html - https://man.openbsd.org/statfs - http://lingrok.org/xref/coreutils/src/df.c#893 |
||
---|---|---|
.. | ||
disk_test.go | ||
disk.go | ||
stat_bsd.go | ||
stat_fallback.go | ||
stat_linux.go | ||
stat_openbsd.go | ||
stat_windows.go | ||
type_bsd.go | ||
type_linux.go | ||
type_windows.go |