Skip to content

fix: fall back to fusermount when /dev/fuse is inaccessible#1

Merged
XciD merged 1 commit into
huggingface:sidecar-multi-fdfrom
nikhiljha:fusermount-fallback
May 21, 2026
Merged

fix: fall back to fusermount when /dev/fuse is inaccessible#1
XciD merged 1 commit into
huggingface:sidecar-multi-fdfrom
nikhiljha:fusermount-fallback

Conversation

@nikhiljha
Copy link
Copy Markdown
Contributor

`fuse_mount_sys` already falls back to fusermount on `mount(2)` EPERM, but returns a hard error when `DevFuse::open()` fails. This means unprivileged containers that lack `/dev/fuse` but have a (possibly proxied) fusermount binary never reach the fallback path.

This returns `Ok(None)` on `NotFound`/`PermissionDenied` from `DevFuse::open()` so the caller retries via fusermount, matching the `mount(2)` behavior.

fuse_mount_sys already falls back to fusermount on mount(2) EPERM,
but returns a hard error when DevFuse::open() fails. This means
unprivileged containers that lack /dev/fuse but have a (possibly
proxied) fusermount binary never reach the fallback path.

Return Ok(None) on NotFound/PermissionDenied from DevFuse::open()
so the caller retries via fusermount, matching the mount(2) behavior.
@XciD
Copy link
Copy Markdown
Member

XciD commented May 4, 2026

Can you push this on upstream fuser ? I would like to push my commit too

@XciD
Copy link
Copy Markdown
Member

XciD commented May 21, 2026

Merging for now

@XciD XciD merged commit 43f80f8 into huggingface:sidecar-multi-fd May 21, 2026
XciD added a commit to huggingface/hf-mount that referenced this pull request May 21, 2026
## Summary

Bumps the pinned `fuser` SHA on the `sidecar-multi-fd` branch of
`huggingface/fuser` to pick up [PR
#1](huggingface/fuser#1), which makes
`fuse_mount_pure` fall back to `fusermount` when `DevFuse::open()`
returns `NotFound` or `PermissionDenied`. Previously the fallback path
only fired on `mount(2) EPERM`, so an inaccessible `/dev/fuse` (typical
in unprivileged Kubernetes pods) bailed out hard before fusermount was
ever tried.

Closes #147. Unblocks
[skypilot-org/skypilot#9418](skypilot-org/skypilot#9418).

## Verification

Reproduced on an AL2023 EC2 box by `chmod 0` on `/dev/fuse` (simulating
an unprivileged container with no device access):

Before:
```
ERROR Permission denied: mounting a FUSE filesystem requires root privileges. Try running with: sudo ...
ERROR FUSE mount failed: Permission denied (os error 13)
```

After (with the bumped fuser):
```
ERROR FUSE mount failed: fusermount: failed to open /dev/fuse: Permission denied
```

The error provenance shifts from the direct `DevFuse::open` path to
`fusermount`, confirming the fallback is now taken. In a real
unprivileged-Kubernetes setup where fusermount is proxied to a
privileged host context (as SkyPilot does), this path succeeds
end-to-end.
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