mountlib: fix VFS instance leaks on mount failures and unmounts

This commit is contained in:
Hakan İSMAİL
2026-08-18 09:03:12 +01:00
committed by Nick Craig-Wood
parent f425f8d466
commit 45ddf3a5f2
5 changed files with 27 additions and 19 deletions
-2
View File
@@ -117,7 +117,6 @@ func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (asyncerrors
out, umountErr = exec.Command(cmd[0], cmd[1:]...).CombinedOutput()
}
shutdownErr := s.Shutdown()
VFS.Shutdown()
if umountErr != nil {
out = bytes.TrimSpace(out)
return fmt.Errorf("%s: failed to umount the NFS volume %e", out, umountErr)
@@ -130,7 +129,6 @@ func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (asyncerrors
nfs.OnUnmountFunc = func() {
s.UnmountedExternally = true
errChan <- nil
VFS.Shutdown()
}
actualMountpoint = mountpoint