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)
Feb 22 2024, 4:03 AM
Unknown Object (File)
Dec 20 2023, 4:23 AM
Unknown Object (File)
Oct 18 2023, 2:43 AM
Unknown Object (File)
Oct 15 2023, 8:14 AM
Unknown Object (File)
Oct 15 2023, 8:14 AM
Unknown Object (File)
Jun 20 2023, 6:33 PM
Unknown Object (File)
May 9 2023, 11:26 AM
Unknown Object (File)
May 3 2023, 9:08 PM
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