mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
util: do not use mount-utils.IsLikelyNotMountPoint
anymore
`IsLikelyNotMountPoint()` is an optimized version for `IsMountPoint()` which can not detect all type of mounts (anymore). The slower `IsMountPoint()` is more safe to use. This can cause a slight performance regression in the case there are many mountpoints on the system, but correctness is more important than speed while mounting. Fixes: #4633 Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
76b4f53897
commit
79cf0321dd
@ -200,19 +200,19 @@ func (ns *NodeServer) mountNFS(
|
||||
err error
|
||||
)
|
||||
|
||||
notMnt, err := ns.Mounter.IsLikelyNotMountPoint(mountPoint)
|
||||
isMnt, err := ns.Mounter.IsMountPoint(mountPoint)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
err = os.MkdirAll(mountPoint, defaultMountPermission)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
notMnt = true
|
||||
isMnt = false
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if !notMnt {
|
||||
if isMnt {
|
||||
log.DebugLog(ctx, "nfs: volume is already mounted to %s", mountPoint)
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user