summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Oliver <github.com@mavit.org.uk>2016-09-09 22:39:39 +0100
committerBrian Coca <bcoca@users.noreply.github.com>2016-09-09 17:39:39 -0400
commitc87d84f5b8b222de737a249657fd8dfa6509f013 (patch)
tree161ae66931dd5c69c265c4491b0963ca1638f635
parenta3028783d4a7feaeec39ffab7d8b048c7a6aad07 (diff)
downloadansible-c87d84f5b8b222de737a249657fd8dfa6509f013.tar.gz
Filesystem blocks are of size `f_frsize` (#17493)
The statvfs(3) manpage on Linux states that `f_blocks` is the "size of fs in `f_frsize` units". The manpages on Solaris and AIX state something similar. With ext4 on Linux, I suspect that `f_bsize` and `f_frsize` are always identical, masking this error. On Solaris, the sizes differ for each of ufs, vxfs and zfs causing the `size_available` and `size_total` facts to be set incorrectly on this OS.
-rw-r--r--lib/ansible/module_utils/facts.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py
index d740efc037..325f5a9931 100644
--- a/lib/ansible/module_utils/facts.py
+++ b/lib/ansible/module_utils/facts.py
@@ -581,8 +581,8 @@ class Facts(object):
size_available = None
try:
statvfs_result = os.statvfs(mountpoint)
- size_total = statvfs_result.f_bsize * statvfs_result.f_blocks
- size_available = statvfs_result.f_bsize * (statvfs_result.f_bavail)
+ size_total = statvfs_result.f_frsize * statvfs_result.f_blocks
+ size_available = statvfs_result.f_frsize * (statvfs_result.f_bavail)
except OSError:
pass
return size_total, size_available