mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
fix: alow changes to readAllData to decrement activeCount()
This commit is contained in:
parent
37960cbc2f
commit
2f4af09c01
@ -1190,7 +1190,16 @@ func (s *xlStorage) readAllData(volumeDir string, filePath string, requireDirect
|
|||||||
}
|
}
|
||||||
|
|
||||||
atomic.AddInt32(&s.activeIOCount, 1)
|
atomic.AddInt32(&s.activeIOCount, 1)
|
||||||
rd := &odirectReader{f, nil, nil, true, true, s, nil}
|
or := &odirectReader{f, nil, nil, true, true, s, nil}
|
||||||
|
rd := struct {
|
||||||
|
io.Reader
|
||||||
|
io.Closer
|
||||||
|
}{Reader: or, Closer: closeWrapper(func() error {
|
||||||
|
defer func() {
|
||||||
|
atomic.AddInt32(&s.activeIOCount, -1)
|
||||||
|
}()
|
||||||
|
return or.Close()
|
||||||
|
})}
|
||||||
defer rd.Close() // activeIOCount is decremented in Close()
|
defer rd.Close() // activeIOCount is decremented in Close()
|
||||||
|
|
||||||
buf, err = ioutil.ReadAll(rd)
|
buf, err = ioutil.ReadAll(rd)
|
||||||
|
Loading…
Reference in New Issue
Block a user