mirror of
https://github.com/minio/minio.git
synced 2026-11-23 23:17:48 +00:00
fix size accounting for encrypted/compressed objects (#9690)
size calculation in crawler was using the real size of the object instead of its actual size i.e either a decrypted or uncompressed size. this is needed to make sure all other accounting such as bucket quota and mcs UI to display the correct values.
This commit is contained in:
1 parent
bc285cf0dd
commit
0c71ce3398
9 files changed
+70
-126
No files matched your search
+9
-1
@@ -383,7 +383,15 @@ func (s *posix) CrawlAndGetDataUsage(ctx context.Context, cache dataUsageCache)
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
return meta.Stat.Size, nil
|
||||
// we don't necessarily care about the names
|
||||
// of bucket and object, only interested in size.
|
||||
// so use some dummy names.
|
||||
size, err := meta.ToObjectInfo("dummy", "dummy").GetActualSize()
|
||||
if err != nil {
|
||||
return 0, errSkipFile
|
||||
}
|
||||
return size, nil
|
||||
|
||||
})
|
||||
if err != nil {
|
||||
return dataUsageInfo, err
|
||||
|
||||
Reference in new issue
Block a user