mountlib: rc: fix mounts created with mountPoint "*" overwriting each other
On Windows, passing "*" as mountPoint to the mount/mount RC command auto-assigns a drive letter (e.g. "Z:"), but the resolved letter was never propagated back to mountlib. This caused liveMounts to be keyed on the literal "*", breaking tracking of multiple mounts and making unmount unreliable. Change MountFn to return the actual mount point as an additional return value. Update MountPoint.Mount() to store the resolved value, and mountRc() to use it as the liveMounts key. The mount/mount RC response now returns the actual mountPoint so callers can discover which drive letter was assigned.
This commit is contained in:
@@ -35,7 +35,7 @@ func init() {
|
||||
nfs.AddFlags(cmdFlags)
|
||||
}
|
||||
|
||||
func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (asyncerrors <-chan error, unmount func() error, err error) {
|
||||
func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (asyncerrors <-chan error, unmount func() error, actualMountpoint string, err error) {
|
||||
s, err := nfs.NewServer(context.Background(), VFS, &nfs.Opt)
|
||||
if err != nil {
|
||||
return
|
||||
@@ -112,5 +112,6 @@ func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (asyncerrors
|
||||
VFS.Shutdown()
|
||||
}
|
||||
|
||||
actualMountpoint = mountpoint
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user