mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 12:10:24 +03:00
xl: Heal empty parts (#7860)
posix.VerifyFile() doesn't know how to check if a file is corrupted if that file is empty. We do have the part size in xl.json so we pass it to VerifyFile to return an error so healing empty parts can work properly.
This commit is contained in:
@@ -196,9 +196,9 @@ func (d *naughtyDisk) ReadAll(volume string, path string) (buf []byte, err error
|
||||
return d.disk.ReadAll(volume, path)
|
||||
}
|
||||
|
||||
func (d *naughtyDisk) VerifyFile(volume, path string, algo BitrotAlgorithm, sum []byte, shardSize int64) error {
|
||||
func (d *naughtyDisk) VerifyFile(volume, path string, empty bool, algo BitrotAlgorithm, sum []byte, shardSize int64) error {
|
||||
if err := d.calcError(); err != nil {
|
||||
return err
|
||||
}
|
||||
return d.disk.VerifyFile(volume, path, algo, sum, shardSize)
|
||||
return d.disk.VerifyFile(volume, path, empty, algo, sum, shardSize)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user