Skip to content

Commit ab4d08a

Browse files
j4ckstrawk8s-publishing-bot
authored andcommitted
fix logic error
Signed-off-by: j4ckstraw <[email protected]> Kubernetes-commit: c3775de7479b4cb8048d56040364b4f7b4e3b425
1 parent c95382c commit ab4d08a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mount_linux.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) {
442442
return mounter.isLikelyNotMountPoint(file)
443443
}
444444

445-
return false, err
445+
return true, err
446446
}
447447

448448
if stat.Attributes_mask != 0 {
@@ -459,10 +459,10 @@ func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) {
459459

460460
root := filepath.Dir(strings.TrimSuffix(file, "/"))
461461
if rootStat, err = statx(root); err != nil {
462-
return false, err
462+
return true, err
463463
}
464464

465-
return !(stat.Dev_major == rootStat.Dev_major && stat.Dev_minor == rootStat.Dev_minor), nil
465+
return (stat.Dev_major == rootStat.Dev_major && stat.Dev_minor == rootStat.Dev_minor), nil
466466
}
467467

468468
// CanSafelySkipMountPointCheck relies on the detected behavior of umount when given a target that is not a mount point.

0 commit comments

Comments
 (0)