HomeFreeBSD

sys/fs: do not report blocks allocated for synthetic file systems

Description

sys/fs: do not report blocks allocated for synthetic file systems

The pseudo file systems (devfs, fdescfs, procfs, etc.) report total
and available blocks and inodes despite being synthetic with no
underlying storage device to which those values could be applied.

The current code of these file systems tends to report a fixed number
of total blocks but no free blocks, and in the case of procfs,
libprocfs, linsysfs also no free inodes.

This can be irritating in e.g. the "df" output, since 100% of the
resources seem to be in use, but it can also create warnings in
monitoring tools used for capacity management.

This patch makes these file systems return the same value for the
total and free parameters, leading to 0% in use being displayed by
"df". Since there is no resource that can be exhausted, this appears
to be a sensible result.

Reviewed by: mckusick
Differential Revision: https://reviews.freebsd.org/D39442

(cherry picked from commit 88a795e80c03ff1d960d830ee273589664ab06cc)

Details

Provenance
seAuthored on Apr 25 2023, 7:40 AM
Reviewer
mckusick
Differential Revision
D39442: Report sensible values for blocks and inodes of procfs etc.
Parents
rGd767bf361b3e: msdosfs: fix debug print format and parameter
Branches
Unknown
Tags
Unknown