From faebccf4c6c61ce76312bd054ad44874a6618422 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 21 Jul 2024 10:37:26 +0200 Subject: [PATCH] directmount: take fsname from opts, not cfg 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 https://github.com/jacobsa/fuse/issues/166 --- mount_linux.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mount_linux.go b/mount_linux.go index 7914f6e8..402dc467 100644 --- a/mount_linux.go +++ b/mount_linux.go @@ -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 { @@ -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