Page MenuHomeFreeBSD

Report sensible values for blocks and inodes of procfs etc.
ClosedPublic

Authored by se on Apr 5 2023, 9:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 1 2024, 5:49 PM
Unknown Object (File)
Oct 1 2024, 1:40 PM
Unknown Object (File)
Sep 30 2024, 11:18 AM
Unknown Object (File)
Sep 29 2024, 8:43 PM
Unknown Object (File)
Sep 29 2024, 12:29 PM
Unknown Object (File)
Sep 29 2024, 12:28 PM
Unknown Object (File)
Sep 29 2024, 10:30 AM
Unknown Object (File)
Sep 29 2024, 7:07 AM
Subscribers

Details

Summary

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 blocks but no free blocks, and in the case of procfs, libprocfs, linsysfs also no free inodes.
This can be irritating in 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 is a sensible result.

Test Plan

Apply patch and verify that the misleading 100% consumed values have become 0% in the output of df.
For devfs and fdescfs a value of 1 KB is returned for total and free blocks.
For procfs etc. a value of 1 page (i.e. 4 KB for most current architectures) is returned for both values.
In each case the number of total and used inodes returned is fixed at 0, except for fdescfs which continues to display a huge number of available file descriptor table entries and the number of used file descriptors respectively.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable