nfsmount: fix stale handle problem after converting options to new style

This problem was caused by the defaults not being set for the options
after the conversion to the new config system in

28ba4b832d serve nfs: convert options to new style

This makes the nfs serve options globally available so nfsmount can
use them directly.

Fixes #8029
This commit is contained in:
Nick Craig-Wood
2024-08-28 07:08:23 +01:00
parent 3bb6d0a42b
commit a365503750
3 changed files with 12 additions and 11 deletions
+3 -4
View File
@@ -21,8 +21,7 @@ import (
)
var (
sudo = false
nfsServerOpt nfs.Options
sudo = false
)
func init() {
@@ -33,11 +32,11 @@ func init() {
mountlib.AddRc(name, mount)
cmdFlags := cmd.Flags()
flags.BoolVarP(cmdFlags, &sudo, "sudo", "", sudo, "Use sudo to run the mount/umount commands as root.", "")
nfs.AddFlags(cmdFlags, &nfsServerOpt)
nfs.AddFlags(cmdFlags)
}
func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (asyncerrors <-chan error, unmount func() error, err error) {
s, err := nfs.NewServer(context.Background(), VFS, &nfsServerOpt)
s, err := nfs.NewServer(context.Background(), VFS, &nfs.Opt)
if err != nil {
return
}