Re: [PATCH 06/43] xfs: refactor xfs_fs_statfs

Christoph Hellwig
2024-12-13T05:08:07Z

On Thu, Dec 12, 2024 at 01:24:00PM -0800, Darrick J. Wong wrote:
> > + * XFS does not distinguish between blocks available to privileged and
> > + * unprivileged users.
> > + */
> > + st->f_bavail = st->f_bfree;
>
> Not relevant to this patch, but I noticed that (a) the statfs manpage
> now tells me to go look at statvfs, and (b) statvfs advertises a
> f_favail field that nobody in the kernel actually sets.

The kernel doesn't implement statvfs and thus doesn't have the field.
This is what glibc does for it:

/* XXX I have no idea how to compute f_favail. Any idea??? */
buf->f_favail = buf->f_ffree;