mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user