Skip to content
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

Implement statfs with synthetic values #871

Closed
wants to merge 1 commit into from

Conversation

dannycjones
Copy link
Contributor

@dannycjones dannycjones commented May 8, 2024

Description of change

Draft prototype change for now. May not be merged.

Some applications do not work as expected when a file system reports available space as zero. Some applications may check for available space, and fail if that's a small number (like zero). I believe even df -h will not report the file system in the list by default for some reason - and this may fix it (TBC).

Next steps:

  • Are these the right fields to change? What use cases are we solving?
  • Confirm that we do actually want to implement statfs by default, diverging from the values provided by Fuser.
  • Converge on an agreed value for these fields.
  • Merge.

Relevant issues: #710

Does this change impact existing behavior?

Mountpoint will now report a non-zero number of available blocks, free blocks, and free files. Before, it reported zero for all three values.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

@dannycjones dannycjones temporarily deployed to PR integration tests May 8, 2024 08:02 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests May 8, 2024 08:02 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests May 8, 2024 08:02 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests May 8, 2024 08:02 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests May 8, 2024 08:02 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests May 8, 2024 08:02 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests May 8, 2024 08:02 — with GitHub Actions Inactive
@passaro
Copy link
Contributor

passaro commented May 10, 2024

How do we think this should show up in df? This is what I now get on AL2:

$ df -ha
Filesystem      Size  Used Avail Use% Mounted on
[...]
mountpoint-s3      0 -4.0Z  4.0Z    - /path/to/mnt

While before it was:

mountpoint-s3      0     0     0    - /path/to/mnt

Note that in both cases I needed the --all flag. Did you expect that to change?

@dannycjones
Copy link
Contributor Author

dannycjones commented May 10, 2024

How do we think this should show up in df? This is what I now get on AL2:

$ df -ha
Filesystem      Size  Used Avail Use% Mounted on
[...]
mountpoint-s3      0 -4.0Z  4.0Z    - /path/to/mnt

While before it was:

mountpoint-s3      0     0     0    - /path/to/mnt

Note that in both cases I needed the --all flag. Did you expect that to change?

I was hoping it would change based only on previous discussions a while back. Looks like it doesn't.

What's also unexpected there is that we have a negative used value which I imagine we'd want to avoid.

@dannycjones
Copy link
Contributor Author

Closing this PR for now since I have no intention at the moment of working on it further. However, hopefully this is a good starting point if we do want to move forward with it.

github-merge-queue bot pushed a commit that referenced this pull request Nov 21, 2024
## Description of change
This PR adds support for calling `statfs` on virtual file system created
using mountpoint.
Some applications depend on the filesystem reporting non-zero available
space; currently mountpoint reports 0 as number of available blocks,
which can cause these applications to not work as expected.

This PR (building on #871) implements statfs with synthetic values
(4611686018427387904 free blocks).
For example, the DF output now is: 
```
mountpoint-s3  4611686018427387904        0 4611686018427387904   0% /local/home/chagem/mnt/bucket
```
Thus, checks for available space should no longer fail. 


Relevant issues: #710.  


### Does this change impact existing behavior?

This change impacts existing behaviour, as Mountpoint will report
non-zero value for total blocks, free blocks, free inodes and maximum
file name length.

### Does this change need a changelog entry?

Yes, addressed.

---

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and I agree to the terms of
the [Developer Certificate of Origin
(DCO)](https://developercertificate.org/).

---------

Signed-off-by: Christian Hagemeier <chagem@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants