From 0b27a3a58981f8ebad673f77f17bfd73050e716b Mon Sep 17 00:00:00 2001 From: Brock Johnson Date: Mon, 25 Aug 2025 15:28:53 -0400 Subject: [PATCH] Continue on EINVAL for sas_phy sysfs files Signed-off-by: Brock Johnson --- sysfs/class_sas_phy.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sysfs/class_sas_phy.go b/sysfs/class_sas_phy.go index 67bd7a68..c49df184 100644 --- a/sysfs/class_sas_phy.go +++ b/sysfs/class_sas_phy.go @@ -17,11 +17,13 @@ package sysfs import ( + "errors" "fmt" "os" "path/filepath" "strconv" "strings" + "syscall" "github.com/prometheus/procfs/internal/util" ) @@ -97,7 +99,7 @@ func (fs FS) parseSASPhy(name string) (*SASPhy, error) { if fileinfo.Mode().IsRegular() { value, err := util.SysReadFile(name) if err != nil { - if os.IsPermission(err) { + if os.IsPermission(err) || errors.Is(err, syscall.EINVAL) { continue } return nil, fmt.Errorf("failed to read file %q: %w", name, err)