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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

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 requested a deployment to PR integration tests November 5, 2024 11:07 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:07 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:07 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:07 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:07 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:07 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:07 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:39 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:39 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:39 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:39 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:39 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:39 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 11:39 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 13:31 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 13:31 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 13:31 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 13:32 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 13:32 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 13:32 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 13:32 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 14:11 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 14:11 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 14:11 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 14:11 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 14:11 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 14:11 — with GitHub Actions Waiting
@unexge unexge requested a deployment to PR integration tests November 5, 2024 14:11 — with GitHub Actions Waiting
@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 November 8, 2024 10:39 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests November 8, 2024 10:39 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests November 8, 2024 10:39 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests November 8, 2024 10:39 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests November 8, 2024 10:39 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests November 8, 2024 10:39 — with GitHub Actions Inactive
@unexge unexge temporarily deployed to PR integration tests November 8, 2024 10:39 — with GitHub Actions Inactive
@unexge unexge marked this pull request as ready for review November 8, 2024 10:53
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.

1 participant