-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
df(windows): fix Avail/Use% by using number_of_free_clusters for bavail #9470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
GNU testsuite comparison: |
|
could you please add a test to make sure we don't regress in the future? thanks |
9d81e88 to
57198e8
Compare
|
done |
|
GNU testsuite comparison: |
|
@naoNao89 i was thinking about tests/by-util/test_df.rs |
a388c9a to
94dd012
Compare
CodSpeed Performance ReportMerging #9470 will not alter performanceComparing Summary
Footnotes
|
|
GNU testsuite comparison: |
94dd012 to
586f6b7
Compare
|
GNU testsuite comparison: |
Fix Windows
dfincorrectly reporting 0 bytes available and 100% usage for all filesystems. The issue was caused by hardcodingbavail(blocks available to non-privileged processes) to 0 instead of using the actual free clusters from Windows API.On Windows, all mounted filesystems displayed:
This made
dfoutput useless for Windows users.Before (Broken)
After (Fixed)
Windows API Context
The fix correctly implements POSIX semantics on Windows:
f_bfreelpNumberOfFreeClusters(no quota consideration)f_bavaillpNumberOfFreeClusters(quota-aware)Windows
GetDiskFreeSpaceW()already respects disk quotas, making this fix semantically correct.Fixes
Closes #7461
Related Issues