DragonFly BSD
DragonFly bugs List (threaded) for 2009-12
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: weird problem with statvfs() on a hammer filesystems


From: Johannes Hofmann <johannes.hofmann@xxxxxx>
Date: 03 Dec 2009 22:36:34 GMT

Matthew Dillon <dillon@apollo.backplane.com> wrote:
> 
> :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;
> 


Haha. That's it. I was staring at this line for quite some time and
started to blame compiler bugs and cosmic rays.

Thanks,
Johannes



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]