diff --git a/pkg/local_object_storage/blobstor/blobstor.go b/pkg/local_object_storage/blobstor/blobstor.go index e0d4dc1e3..ab9eeb7fd 100644 --- a/pkg/local_object_storage/blobstor/blobstor.go +++ b/pkg/local_object_storage/blobstor/blobstor.go @@ -61,7 +61,7 @@ func New(opts ...Option) *BlobStor { // Depth is reduced to maximum value in case of overflow. func WithShallowDepth(depth int) Option { return func(c *cfg) { - if depth <= maxDepth { + if depth > maxDepth { depth = maxDepth } diff --git a/pkg/local_object_storage/blobstor/fstree.go b/pkg/local_object_storage/blobstor/fstree.go index 29dd6048c..d5d904a11 100644 --- a/pkg/local_object_storage/blobstor/fstree.go +++ b/pkg/local_object_storage/blobstor/fstree.go @@ -22,7 +22,7 @@ type fsTree struct { const dirNameLen = 2 // in bytes -var maxDepth = (hex.EncodedLen(sha256.Size) - 1) / dirNameLen +var maxDepth = (sha256.Size - 1) / dirNameLen var errFileNotFound = errors.New("file not found")