fuse: add host FD passthrough for external FUSE servers#13575
Open
copybara-service[bot] wants to merge 1 commit into
Open
fuse: add host FD passthrough for external FUSE servers#13575copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
4c8be56 to
c0e0fbf
Compare
## Summary - Add `hostConnection` type that performs synchronous FUSE protocol I/O over a host file descriptor, enabling FUSE servers running outside the sandbox to serve filesystem requests for processes inside - Detect host FDs in `GetFilesystem` via a `HostFD()` interface check and branch to a new `getFilesystemHostFD` path that creates the host connection and performs `FUSE_INIT` synchronously - Route all `Call`/`CallAsync` operations through `fuseCall`/`fuseCallAsync` dispatch methods on `filesystem` that forward to `hostConn` when set ## Test plan - [x] Unit tests (`host_connection_test.go`): basic echo call, FUSE_INIT handshake, async call, not-connected error — all using socketpair-based mock servers - [x] Integration tests (`host_connection_integration_test.go`): full FUSE protocol lifecycle (INIT → LOOKUP → OPEN → READ → RELEASE and WRITE → verify backing file) with a real temp directory-backed FUSE server - [x] Syscall integration tests (`fuse_host.cc`): `StatRoot`, `ReadFile`, `WriteAndReadBack` — exercised via the `_fuse_host` test runner variant with host-side `fuse_host` server binary - [x] Existing FUSE tests pass (no regressions to the DeviceFD path) FUTURE_COPYBARA_INTEGRATE_REVIEW=#13426 from google:lucasmanning/fuse-host-passthrough d4129db PiperOrigin-RevId: 936180483
c0e0fbf to
dd2ee36
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fuse: add host FD passthrough for external FUSE servers
Summary
hostConnectiontype that performs synchronous FUSE protocol I/O over a host file descriptor, enabling FUSE servers running outside the sandbox to serve filesystem requests for processes insideGetFilesystemvia aHostFD()interface check and branch to a newgetFilesystemHostFDpath that creates the host connection and performsFUSE_INITsynchronouslyCall/CallAsyncoperations throughfuseCall/fuseCallAsyncdispatch methods onfilesystemthat forward tohostConnwhen setTest plan
host_connection_test.go): basic echo call, FUSE_INIT handshake, async call, not-connected error — all using socketpair-based mock servershost_connection_integration_test.go): full FUSE protocol lifecycle (INIT → LOOKUP → OPEN → READ → RELEASE and WRITE → verify backing file) with a real temp directory-backed FUSE serverfuse_host.cc):StatRoot,ReadFile,WriteAndReadBack— exercised via the_fuse_hosttest runner variant with host-sidefuse_hostserver binaryFUTURE_COPYBARA_INTEGRATE_REVIEW=#13426 from google:lucasmanning/fuse-host-passthrough d4129db