Subject: | [Patch] "user_blocks" calculation fails for empty file systems |
Date: | Sat, 1 Oct 2016 21:18:23 +0200 |
To: | bug-filesys-df [...] rt.cpan.org |
From: | Christoph Biedl <debian.axhn [...] manchmal.in-ulm.de> |
Hello,
Filesys::Df 0.92 does not provide a user_blocks record if the file
system is completely empty (and there are no reserved blocks either),
or in other words: If bfree == bavail.
Fix is trivial, see below.
Christoph
--- /usr/lib/x86_64-linux-gnu/perl5/5.20/Filesys/Df.pm
+++ /usr/lib/x86_64-linux-gnu/perl5/5.20/Filesys/Df.pm
@@ -73,7 +73,7 @@
#### There is a reserved amount for the su
#### or there are disk quotas
- if($bfree > $bavail) {
+ if($bfree >= $bavail) {
$user_blocks = $blocks - ($bfree - $bavail);
$user_used = $user_blocks - $bavail;
if($bavail < 0) {
Message body not shown because it is not plain text.