mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix dead lock in volume store dereference
Signed-off-by: Pei Su <sillyousu@gmail.com>
This commit is contained in:
parent
805a107df4
commit
f5310652d3
1 changed files with 1 additions and 1 deletions
|
@ -293,6 +293,7 @@ func (s *VolumeStore) Dereference(v volume.Volume, ref string) {
|
||||||
defer s.locks.Unlock(v.Name())
|
defer s.locks.Unlock(v.Name())
|
||||||
|
|
||||||
s.globalLock.Lock()
|
s.globalLock.Lock()
|
||||||
|
defer s.globalLock.Unlock()
|
||||||
refs, exists := s.refs[v.Name()]
|
refs, exists := s.refs[v.Name()]
|
||||||
if !exists {
|
if !exists {
|
||||||
return
|
return
|
||||||
|
@ -303,7 +304,6 @@ func (s *VolumeStore) Dereference(v volume.Volume, ref string) {
|
||||||
s.refs[v.Name()] = append(s.refs[v.Name()][:i], s.refs[v.Name()][i+1:]...)
|
s.refs[v.Name()] = append(s.refs[v.Name()][:i], s.refs[v.Name()][i+1:]...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s.globalLock.Unlock()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refs gets the current list of refs for the given volume
|
// Refs gets the current list of refs for the given volume
|
||||||
|
|
Loading…
Reference in a new issue