mountlib: fix VFS instance leaks on mount failures and unmounts
This commit is contained in:
committed by
Nick Craig-Wood
parent
f425f8d466
commit
45ddf3a5f2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user