From 4bb023927936ae8ac0de06347c68a70c682d53b8 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 9 May 2023 15:10:17 -0700 Subject: [PATCH] mount-utils: IsMountPoint: fix Commit 44bea358045e0 added a code to return unwrapped fs.ErrNotExist error in case filepath.EvalSymlinks failed a wrapped one. This never worked because of a copy/paste bug. Fix this. Fixes: 44bea358045e0 Cc: Manu Gupta Signed-off-by: Kir Kolyshkin --- staging/src/k8s.io/mount-utils/mount_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/mount-utils/mount_linux.go b/staging/src/k8s.io/mount-utils/mount_linux.go index dc861734ad5..005f447d9d8 100644 --- a/staging/src/k8s.io/mount-utils/mount_linux.go +++ b/staging/src/k8s.io/mount-utils/mount_linux.go @@ -766,7 +766,7 @@ func (mounter *Mounter) IsMountPoint(file string) (bool, error) { // 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 { - if errors.Is(isMntErr, fs.ErrNotExist) { + if errors.Is(err, fs.ErrNotExist) { return false, fs.ErrNotExist } return false, err