zfs filesystem skipped by df -h

On full pool when pool root filesystem references very few bytes,
the f_blocks returned to statvfs is 0 but should be at least 1.

Reviewed by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
Closes #8253 
Closes #8254
This commit is contained in:
Paul Zuchowski
2019-01-13 13:06:13 -05:00
committed by Brian Behlendorf
parent a13392a6a1
commit 83c796c5e9
4 changed files with 79 additions and 2 deletions
+2
View File
@@ -1449,6 +1449,8 @@ zfs_statvfs(struct dentry *dentry, struct kstatfs *statp)
* "preferred" size.
*/
/* Round up so we never have a filesytem using 0 blocks. */
refdbytes = P2ROUNDUP(refdbytes, statp->f_bsize);
statp->f_blocks = (refdbytes + availbytes) >> bshift;
statp->f_bfree = availbytes >> bshift;
statp->f_bavail = statp->f_bfree; /* no root reservation */