mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 16:23:28 +03:00
erasure: healVolume err should be different from shadowed version. (#1590)
Multiple go-routines updating the same shadowed variable can cause a data race, avoid it by using its own err variable. Fixes #1589
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
49141eb3e4
commit
72748d2073
@@ -51,11 +51,11 @@ func (xl XL) ReadFile(volume, path string, startOffset int64) (io.ReadCloser, er
|
||||
// Heal in background safely, since we already have read
|
||||
// quorum disks. Let the reads continue.
|
||||
go func() {
|
||||
if err = xl.healFile(volume, path); err != nil {
|
||||
if hErr := xl.healFile(volume, path); hErr != nil {
|
||||
log.WithFields(logrus.Fields{
|
||||
"volume": volume,
|
||||
"path": path,
|
||||
}).Errorf("healFile failed with %s", err)
|
||||
}).Errorf("healFile failed with %s", hErr)
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user