From 9983dfa1da1f1bee5ffd525437424b7cc11f2502 Mon Sep 17 00:00:00 2001 From: Jonathan Dobson Date: Wed, 17 Jul 2024 11:30:18 -0600 Subject: [PATCH] mount-utils: treat syscall.ENODEV as corrupted mount Kubernetes-commit: 4cec4e74227349b8f9554dae4707529d7deecb3e --- mount_helper_unix.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mount_helper_unix.go b/mount_helper_unix.go index 9193e7c..1c603dc 100644 --- a/mount_helper_unix.go +++ b/mount_helper_unix.go @@ -61,7 +61,13 @@ func IsCorruptedMnt(err error) bool { underlyingError = err } - return underlyingError == syscall.ENOTCONN || underlyingError == syscall.ESTALE || underlyingError == syscall.EIO || underlyingError == syscall.EACCES || underlyingError == syscall.EHOSTDOWN || underlyingError == syscall.EWOULDBLOCK + return errors.Is(underlyingError, syscall.ENOTCONN) || + errors.Is(underlyingError, syscall.ESTALE) || + errors.Is(underlyingError, syscall.EIO) || + errors.Is(underlyingError, syscall.EACCES) || + errors.Is(underlyingError, syscall.EHOSTDOWN) || + errors.Is(underlyingError, syscall.EWOULDBLOCK) || + errors.Is(underlyingError, syscall.ENODEV) } // MountInfo represents a single line in /proc//mountinfo.