Skip to content

Commit

Permalink
Fix hung volume wedge the kubelet
Browse files Browse the repository at this point in the history
see kubernetes#31272, kubernetes#101622

Signed-off-by: j4ckstraw <j4ckstraw@foxmail.com>
  • Loading branch information
j4ckstraw committed Aug 15, 2023
1 parent 6e0cb24 commit 37d510c
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions staging/src/k8s.io/mount-utils/mount_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import (
"syscall"
"time"

"github.com/moby/sys/mountinfo"

"k8s.io/klog/v2"
utilexec "k8s.io/utils/exec"
)
Expand Down Expand Up @@ -746,21 +744,6 @@ func SearchMountPoints(hostSource, mountInfoPath string) ([]string, error) {
// endpoint is called to enumerate all the mountpoints and check if
// it is mountpoint match or not.
func (mounter *Mounter) IsMountPoint(file string) (bool, error) {
isMnt, sure, isMntErr := mountinfo.MountedFast(file)
if sure && isMntErr == nil {
return isMnt, nil
}
if isMntErr != nil {
if errors.Is(isMntErr, fs.ErrNotExist) {
return false, fs.ErrNotExist
}
// We were not allowed to do the simple stat() check, e.g. on NFS with
// root_squash. Fall back to /proc/mounts check below when
// fs.ErrPermission is returned.
if !errors.Is(isMntErr, fs.ErrPermission) {
return false, isMntErr
}
}
// Resolve any symlinks in file, kernel would do the same and use the resolved path in /proc/mounts.
resolvedFile, err := filepath.EvalSymlinks(file)
if err != nil {
Expand Down

0 comments on commit 37d510c

Please sign in to comment.