mount-utils: IsMountPoint: fix

Commit 44bea35804 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: 44bea35804
Cc: Manu Gupta <manugupt1@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2023-05-09 15:10:17 -07:00
parent 167252fb5e
commit 4bb0239279

View File

@ -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. // Resolve any symlinks in file, kernel would do the same and use the resolved path in /proc/mounts.
resolvedFile, err := filepath.EvalSymlinks(file) resolvedFile, err := filepath.EvalSymlinks(file)
if err != nil { if err != nil {
if errors.Is(isMntErr, fs.ErrNotExist) { if errors.Is(err, fs.ErrNotExist) {
return false, fs.ErrNotExist return false, fs.ErrNotExist
} }
return false, err return false, err