df: add a fallback path for statfs with a mount table#12072
df: add a fallback path for statfs with a mount table#12072Gelbpunkt wants to merge 1 commit intouutils:mainfrom
Conversation
|
This now matches GNU coreutils: I also tried just always using the fallback codepath, but it wouldn't match GNU coreutils in output since it cannot consider the mount table. The behavior for GNU coreutils is inferred based on observations and |
Merging this PR will improve performance by 4.62%
Performance Changes
Comparing Footnotes
|
|
GNU testsuite comparison: |
There are situations where the mount table would not contain an entry for /, so df /usr would fail if there was not a mount entry for / or /usr. GNU coreutils however behave a little different here: it seems like they also use the statfs fallback to find the filesystem that the path is on and then print the last mountpoint in the mount table that is on the same filesystem. Add such a fallback.
57c7fc6 to
96ddd7c
Compare
There are situations where the mount table would not contain an entry for /, so df /usr would fail if there was not a mount entry for / or /usr. GNU coreutils however behave a little different here: it seems like they also use the statfs fallback to find the filesystem that the path is on and then print the last mountpoint in the mount table that is on the same filesystem. Add such a fallback.
Fixes #11780