mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
Return bit-rot verified data instead of re-reading from disk (#5568)
- Data from disk was being read after bitrot verification to return data for GetObject. Strictly speaking this does not guarantee bitrot protection, as disks may return bad data even temporarily. - This fix reads data from disk, verifies data for bitrot and then returns data to the client directly.
This commit is contained in:
committed by
Harshavardhana
parent
52eea7b9c1
commit
ea8973b7d7
@@ -74,11 +74,11 @@ func (xl xlObjects) isObject(bucket, prefix string) (ok bool) {
|
||||
// Calculate the space occupied by an object in a single disk
|
||||
func (xl xlObjects) sizeOnDisk(fileSize int64, blockSize int64, dataBlocks int) int64 {
|
||||
numBlocks := fileSize / blockSize
|
||||
chunkSize := getChunkSize(blockSize, dataBlocks)
|
||||
chunkSize := ceilFrac(blockSize, int64(dataBlocks))
|
||||
sizeInDisk := numBlocks * chunkSize
|
||||
remaining := fileSize % blockSize
|
||||
if remaining > 0 {
|
||||
sizeInDisk += getChunkSize(remaining, dataBlocks)
|
||||
sizeInDisk += ceilFrac(remaining, int64(dataBlocks))
|
||||
}
|
||||
|
||||
return sizeInDisk
|
||||
|
||||
Reference in New Issue
Block a user