Skip to content

fuse: add host FD passthrough for external FUSE servers#13575

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl936180483
Open

fuse: add host FD passthrough for external FUSE servers#13575
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl936180483

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jun 26, 2026

Copy link
Copy Markdown

fuse: add host FD passthrough for external FUSE servers

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

  • Unit tests (host_connection_test.go): basic echo call, FUSE_INIT handshake, async call, not-connected error — all using socketpair-based mock servers
  • 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
  • Syscall integration tests (fuse_host.cc): StatRoot, ReadFile, WriteAndReadBack — exercised via the _fuse_host test runner variant with host-side fuse_host server binary
  • Existing FUSE tests pass (no regressions to the DeviceFD path)

FUTURE_COPYBARA_INTEGRATE_REVIEW=#13426 from google:lucasmanning/fuse-host-passthrough d4129db

@copybara-service copybara-service Bot added the exported Issue was exported automatically label Jun 26, 2026
@copybara-service copybara-service Bot force-pushed the test/cl936180483 branch 14 times, most recently from 4c8be56 to c0e0fbf Compare June 30, 2026 02:17
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant