diff --git a/cmd/admin-handlers-users.go b/cmd/admin-handlers-users.go index 97e8aa1c9..c0b054296 100644 --- a/cmd/admin-handlers-users.go +++ b/cmd/admin-handlers-users.go @@ -1069,11 +1069,7 @@ func (a adminAPIHandlers) AccountInfoHandler(w http.ResponseWriter, r *http.Requ var err error if !globalIsGateway { // Load the latest calculated data usage - dataUsageInfo, err = loadDataUsageFromBackend(ctx, objectAPI) - if err != nil { - // log the error, continue with the accounting response - logger.LogIf(ctx, err) - } + dataUsageInfo, _ = loadDataUsageFromBackend(ctx, objectAPI) } // If etcd, dns federation configured list buckets from etcd. @@ -1142,11 +1138,7 @@ func (a adminAPIHandlers) AccountInfoHandler(w http.ResponseWriter, r *http.Requ // Fetch the prefix usage of the current bucket var prefixUsage map[string]uint64 if enablePrefixUsage { - if pu, err := loadPrefixUsageFromBackend(ctx, objectAPI, bucket.Name); err == nil { - prefixUsage = pu - } else { - logger.LogIf(ctx, err) - } + prefixUsage, _ = loadPrefixUsageFromBackend(ctx, objectAPI, bucket.Name) } lcfg, _ := globalBucketObjectLockSys.Get(bucket.Name) diff --git a/cmd/data-usage.go b/cmd/data-usage.go index 328a0f236..ce9cc90d3 100644 --- a/cmd/data-usage.go +++ b/cmd/data-usage.go @@ -19,6 +19,7 @@ package cmd import ( "context" + "errors" "strings" jsoniter "github.com/json-iterator/go" @@ -90,7 +91,7 @@ func loadPrefixUsageFromBackend(ctx context.Context, objAPI ObjectLayer, bucket func loadDataUsageFromBackend(ctx context.Context, objAPI ObjectLayer) (DataUsageInfo, error) { buf, err := readConfig(ctx, objAPI, dataUsageObjNamePath) if err != nil { - if isErrObjectNotFound(err) || isErrBucketNotFound(err) { + if errors.Is(err, errConfigNotFound) { return DataUsageInfo{}, nil } return DataUsageInfo{}, toObjectErr(err, minioMetaBucket, dataUsageObjNamePath)