From 5a18d437ce840c415890cb908c5ecf24974dea97 Mon Sep 17 00:00:00 2001 From: Shireesh Anjal <355479+anjalshireesh@users.noreply.github.com> Date: Wed, 10 Feb 2021 22:18:14 +0530 Subject: [PATCH] fix: drive hw info incomplete when smartinfo fails (#11509) Collection of SMART information doesn't work in certain scenarios e.g. in a container based setup. In such cases, instead of returning an error (without any data), we should only set the error on the smartinfo struct, so that other important drive hw info like device, mountpoint, etc is retained in the output. --- cmd/healthinfo_linux.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cmd/healthinfo_linux.go b/cmd/healthinfo_linux.go index a623f84fe..8db9de5e6 100644 --- a/cmd/healthinfo_linux.go +++ b/cmd/healthinfo_linux.go @@ -24,7 +24,6 @@ import ( "fmt" "net/http" "strings" - "syscall" "github.com/minio/minio/pkg/madmin" "github.com/minio/minio/pkg/smart" @@ -99,14 +98,7 @@ func getLocalDiskHwInfo(ctx context.Context, r *http.Request) madmin.ServerDiskH paths = append(paths, path) smartInfo, err := smart.GetInfo(device) if err != nil { - if syscall.EACCES == err { - smartInfo.Error = fmt.Sprintf("smart: %v", err) - } else { - return madmin.ServerDiskHwInfo{ - Addr: addr, - Error: fmt.Sprintf("smart: %v", err), - } - } + smartInfo.Error = fmt.Sprintf("smart: %v", err) } partition := madmin.PartitionStat{ Device: part.Device,