fix: [fs] an error upon rwPool.Write() just attempt rwPool.Create() (#10533)

On some NFS clients looks like errno is incorrectly set,
which leads to incorrect errors thrown upwards.
This commit is contained in:
Harshavardhana
2020-09-21 12:54:23 -07:00
committed by GitHub
parent aa12d75d75
commit a5da9120f3
3 changed files with 7 additions and 13 deletions

View File

@@ -94,6 +94,10 @@ func isSysErrNotEmpty(err error) bool {
// Check if the given error corresponds to the specific ERROR_PATH_NOT_FOUND for windows
func isSysErrPathNotFound(err error) bool {
if runtime.GOOS != globalWindowsOSName {
var pathErr *os.PathError
if errors.As(err, &pathErr) {
return pathErr.Err == syscall.ENOENT
}
return false
}
var pathErr *os.PathError