diff --git a/cache/disk/lru.go b/cache/disk/lru.go index d806d91c6..d31ee61be 100644 --- a/cache/disk/lru.go +++ b/cache/disk/lru.go @@ -130,7 +130,7 @@ func (c *sizedLRU) MaxSize() int64 { } func (c *sizedLRU) Reserve(size int64) bool { - if size < 0 || size > c.maxSize || c.currentSize+size > c.maxSize { + if size < 0 || size > c.maxSize || c.reservedSize+size > c.maxSize { return false }