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

Add support for passing FUSE file descriptors as mount point #1103

Merged
merged 35 commits into from
Dec 17, 2024

Conversation

unexge
Copy link
Contributor

@unexge unexge commented Nov 5, 2024

Description of change

fuser v0.15.0 added support for creating a Session from existing FUSE file descriptor (via Session::from_fd). This PR adds this support to Mountpoint. It allows passing FUSE file descriptor as mount point in the form of /dev/fd/{fd}.

An example usage of this feature can be seen with a helper Go script, mounthelper.go:

$ go build mounthelper.go
$ sudo /sbin/setcap 'cap_sys_admin=ep' ./mounthelper # `mount` syscall requires `CAP_SYS_ADMIN`, alternatively, `mounthelper` can be run as root
$ ./mounthelper -mountpoint /tmp/mountpoint -bucket bucketname
bucket bucketname is mounted at /dev/fd/3
2024/11/07 17:23:42 Filesystem mounted, waiting for ctrl+c signal to terminate 

$ # in a different terminal session
$ echo "Hello at `date`" > /tmp/mountpoint/helloworld
$ cat /tmp/mountpoint/helloworld
Hello at Thu Nov  7 17:32:33 UTC 2024
$ rm /tmp/mountpoint/helloworld
$ cat /tmp/mountpoint/helloworld
cat: /tmp/mountpoint/helloworld: No such file or directory

Relevant issues: This PR resurrects a previous PR to add this feature: #537

Does this change impact existing behavior?

Shouldn't affect any existing behavior as we had an “is directory?” check for passed mount points before, and it shouldn't have been possible to pass a file descriptor as a mount point prior to this change.

Does this change need a changelog entry in any of the crates?

Updated CHANGELOG for mountpoint-s3.


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).

@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:07 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:07 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:07 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:07 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:07 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:07 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:07 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:39 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:39 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:39 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:39 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:39 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:39 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 11:39 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 13:31 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 13:31 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 13:31 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 13:32 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 13:32 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 13:32 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 13:32 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 14:11 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 14:11 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 14:11 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 14:11 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 14:11 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 14:11 — with GitHub Actions Failure
@unexge unexge had a problem deploying to PR integration tests November 5, 2024 14:11 — with GitHub Actions Failure
@unexge unexge temporarily deployed to PR integration tests November 5, 2024 14:23 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests November 5, 2024 14:23 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests December 17, 2024 10:50 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests December 17, 2024 10:50 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests December 17, 2024 10:50 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests December 17, 2024 10:50 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests December 17, 2024 10:50 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests December 17, 2024 10:50 — with GitHub Actions Inactive
Signed-off-by: Daniel Carl Jones <[email protected]>
Copy link
Contributor

@dannycjones dannycjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @unexge!

@unexge unexge added this pull request to the merge queue Dec 17, 2024
@unexge unexge removed this pull request from the merge queue due to a manual request Dec 17, 2024
@dannycjones dannycjones added this pull request to the merge queue Dec 17, 2024
Merged via the queue into awslabs:main with commit 602f371 Dec 17, 2024
23 checks passed
@unexge unexge deleted the fuse-fd-support branch December 17, 2024 17:23
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.

3 participants