mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-23 22:40:39 +02:00
mount: register UNC mount points as WinFsp network file systems (#10943)
A \\server\share -dir was passed to WinFsp as a plain mount point, which treats it as a directory path on an actual remote server and fails. Turn it into the VolumePrefix option instead, so the mount registers with the WinFsp network provider: the UNC path is then reachable from every logon session, which a drive letter mounted from a service is not, and each user can map their own drive letter to it.
This commit is contained in:
1 parent
40f77503d0
commit
68f0793b6f
5 files changed
+95
-2
No files matched your search
@@ -192,6 +192,13 @@ var cmdMount = &Command{
|
||||
|
||||
On OS X, it requires OSXFUSE (https://osxfuse.github.io/).
|
||||
|
||||
On Windows, it requires WinFsp (https://winfsp.dev/). The mount point can be
|
||||
a drive letter (-dir=S:), a directory that does not exist yet, or a network
|
||||
path (-dir=\\seaweedfs\share). A drive letter belongs to the logon session
|
||||
that created it, so one mounted by a service is usually invisible to users
|
||||
at the desktop; the network path form is reachable from every session, and
|
||||
each user can map their own drive letter to it.
|
||||
|
||||
RDMA Acceleration:
|
||||
For ultra-fast reads, enable RDMA acceleration with an RDMA sidecar:
|
||||
weed mount -filer=localhost:8888 -dir=/mnt/seaweedfs \
|
||||
|
||||
@@ -136,6 +136,9 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||
glog.V(0).Infof("mounting %s%s to %v", *option.filer, mountRoot, dir)
|
||||
glog.V(0).Infof("This is SeaweedFS version %s %s %s", version.Version(), runtime.GOOS, runtime.GOARCH)
|
||||
glog.V(0).Infof("Windows mount is beta: hard links are unavailable and byte-range locks are not shared across mounts")
|
||||
if prefix, _ := winfsp.VolumePrefix(dir); prefix != "" {
|
||||
glog.V(0).Infof(`network mount: every session on this machine can open \%s or map a drive letter to it`, prefix)
|
||||
}
|
||||
|
||||
if err := host.Serve(windowsMountPoint(dir)); err != nil {
|
||||
glog.Errorf("%v", err)
|
||||
@@ -157,6 +160,9 @@ func checkWindowsMountPoint(dir string) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if prefix, err := winfsp.VolumePrefix(dir); err != nil || prefix != "" {
|
||||
return err
|
||||
}
|
||||
if strings.HasPrefix(dir, `\\`) {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user