weird problem with statvfs() on a hammer filesystems

Matthew Dillon dillon at apollo.backplane.com
Thu Dec 3 10:15:13 PST 2009


:Hi,
:
:I'm seeing a weird problem with statvfs() on a hammer filesystems.
:With this little test program:
:
:..
:
:I get fsbuf.f_bavail == 0 on a freshly mounted hammer FS:

    Ach.  I think I see it.  Try the patch below.

						-Matt

diff --git a/sys/vfs/hammer/hammer_vfsops.c b/sys/vfs/hammer/hammer_vfsops.c
index fa478bf..79321cd 100644
--- a/sys/vfs/hammer/hammer_vfsops.c
+++ b/sys/vfs/hammer/hammer_vfsops.c
@@ -935,7 +935,7 @@ hammer_vfs_statvfs(struct mount *mp, struct statvfs *sbp, struct ucred *cred)
 	hammer_rel_volume(volume, 0);
 
 	mp->mnt_vstat.f_bfree = (bfree - breserved) / HAMMER_BUFSIZE;
-	mp->mnt_vstat.f_bavail = mp->mnt_stat.f_bfree;
+	mp->mnt_vstat.f_bavail = mp->mnt_vstat.f_bfree;
 	if (mp->mnt_vstat.f_files < 0)
 		mp->mnt_vstat.f_files = 0;
 	*sbp = mp->mnt_vstat;






More information about the Bugs mailing list