mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
FC volume plugin: remove unmount of global mount
This commit is contained in:
parent
04c863cb1d
commit
0c262ba9de
@ -79,24 +79,10 @@ func diskTearDown(manager diskManager, c fcDiskUnmounter, volPath string, mounte
|
|||||||
return os.Remove(volPath)
|
return os.Remove(volPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
refs, err := mount.GetMountRefs(mounter, volPath)
|
|
||||||
if err != nil {
|
|
||||||
glog.Errorf("failed to get reference count %s", volPath)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := mounter.Unmount(volPath); err != nil {
|
if err := mounter.Unmount(volPath); err != nil {
|
||||||
glog.Errorf("failed to unmount %s", volPath)
|
glog.Errorf("failed to unmount %s", volPath)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// If len(refs) is 1, then all bind mounts have been removed, and the
|
|
||||||
// remaining reference is the global mount. It is safe to detach.
|
|
||||||
if len(refs) == 1 {
|
|
||||||
mntPath := refs[0]
|
|
||||||
if err := manager.DetachDisk(c, mntPath); err != nil {
|
|
||||||
glog.Errorf("failed to detach disk from %s", mntPath)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
noMnt, mntErr := mounter.IsLikelyNotMountPoint(volPath)
|
noMnt, mntErr := mounter.IsLikelyNotMountPoint(volPath)
|
||||||
if mntErr != nil {
|
if mntErr != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user