diff --git a/pkg/storage/utils/decomposedfs/spaces.go b/pkg/storage/utils/decomposedfs/spaces.go index 2ebb983975f..710800b9a50 100644 --- a/pkg/storage/utils/decomposedfs/spaces.go +++ b/pkg/storage/utils/decomposedfs/spaces.go @@ -25,7 +25,6 @@ import ( "math" "os" "path/filepath" - "strconv" "strings" "time" @@ -867,20 +866,15 @@ func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, n *node.Node, } // quota - quotaAttr, ok := spaceAttributes[prefixes.QuotaAttr] - if ok { + if q, err := spaceAttributes.Int64(prefixes.QuotaAttr); err == nil && q >= 0 { // make sure we have a proper signed int // we use the same magic numbers to indicate: // -1 = uncalculated // -2 = unknown // -3 = unlimited - if quota, err := strconv.ParseUint(string(quotaAttr), 10, 64); err == nil { - space.Quota = &provider.Quota{ - QuotaMaxBytes: quota, - QuotaMaxFiles: math.MaxUint64, // TODO MaxUInt64? = unlimited? why even max files? 0 = unlimited? - } - } else { - return nil, err + space.Quota = &provider.Quota{ + QuotaMaxBytes: uint64(q), + QuotaMaxFiles: math.MaxUint64, // TODO MaxUInt64? = unlimited? why even max files? 0 = unlimited? } } if si := spaceAttributes.String(prefixes.SpaceImageAttr); si != "" {