Skip to content

Commit

Permalink
fix: set "host is down" as corrupted mount
Browse files Browse the repository at this point in the history
add HOSTDOWN code for Windows
  • Loading branch information
andyzhangx committed Apr 27, 2021
1 parent 708b441 commit a37f62b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion staging/src/k8s.io/mount-utils/mount_helper_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func IsCorruptedMnt(err error) bool {
underlyingError = pe.Err
}

return underlyingError == syscall.ENOTCONN || underlyingError == syscall.ESTALE || underlyingError == syscall.EIO || underlyingError == syscall.EACCES
return underlyingError == syscall.ENOTCONN || underlyingError == syscall.ESTALE || underlyingError == syscall.EIO || underlyingError == syscall.EACCES || underlyingError == syscall.EHOSTDOWN
}

// MountInfo represents a single line in /proc/<pid>/mountinfo.
Expand Down
3 changes: 2 additions & 1 deletion staging/src/k8s.io/mount-utils/mount_helper_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ import (
// ERROR_BAD_NET_NAME = 67
// ERROR_SESSION_CREDENTIAL_CONFLICT = 1219
// ERROR_LOGON_FAILURE = 1326
var errorNoList = [...]int{53, 54, 59, 64, 65, 66, 67, 1219, 1326}
// WSAEHOSTDOWN = 10064
var errorNoList = [...]int{53, 54, 59, 64, 65, 66, 67, 1219, 1326, 10064}

// IsCorruptedMnt return true if err is about corrupted mount point
func IsCorruptedMnt(err error) bool {
Expand Down

0 comments on commit a37f62b

Please sign in to comment.