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:
Niels de Vos
2025-03-07 17:09:40 +01:00
committed by mergify[bot]
parent 76b4f53897
commit 79cf0321dd
23 changed files with 599 additions and 112 deletions

View File

@ -219,16 +219,6 @@ func checkDirExists(p string) bool {
return true
}
// IsMountPoint checks if the given path is mountpoint or not.
func IsMountPoint(mounter mount.Interface, p string) (bool, error) {
notMnt, err := mounter.IsLikelyNotMountPoint(p)
if err != nil {
return false, err
}
return !notMnt, nil
}
// IsCorruptedMountError checks if the given error is a result of a corrupted
// mountpoint.
func IsCorruptedMountError(err error) bool {