Skip to content

Commit

Permalink
directmount: take fsname from opts, not cfg
Browse files Browse the repository at this point in the history
This makes the directmount code path pick up this workaround,
which fixes mounting jacobsa/fuse based file systems (which
do not set the FSName explicitly, like the samples) in Docker:

https://github.com/jacobsa/fuse/blob/dd426a02d67d77d065cd0ef38126ac51092a52e0/mount_config.go#L208-L220

fixes #166
  • Loading branch information
stapelberg committed Jul 21, 2024
1 parent dd426a0 commit faebccf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mount_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func directmount(dir string, cfg *MountConfig) (*os.File, error) {
mountflag = fn(mountflag)
delete(opts, k)
}
fsname := opts["fsname"]
delete(opts, "fsname") // handled via fstype mount(2) parameter
fstype := "fuse"
if subtype, ok := opts["subtype"]; ok {
Expand All @@ -96,11 +97,11 @@ func directmount(dir string, cfg *MountConfig) (*os.File, error) {
cfg.DebugLogger.Println("Starting the unix mounting")
}
if err := unix.Mount(
cfg.FSName, // source
dir, // target
fstype, // fstype
mountflag, // mountflag
data, // data
fsname, // source
dir, // target
fstype, // fstype
mountflag, // mountflag
data, // data
); err != nil {
if err == syscall.EPERM {
return nil, errFallback
Expand Down

0 comments on commit faebccf

Please sign in to comment.