Skip to content

Commit

Permalink
fix dead lock in volume store dereference
Browse files Browse the repository at this point in the history
Signed-off-by: Pei Su <sillyousu@gmail.com>
  • Loading branch information
patricksuo committed Jan 27, 2016
1 parent 805a107 commit f531065
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion volume/store/store.go
Expand Up @@ -293,6 +293,7 @@ func (s *VolumeStore) Dereference(v volume.Volume, ref string) {
defer s.locks.Unlock(v.Name())

s.globalLock.Lock()
defer s.globalLock.Unlock()
refs, exists := s.refs[v.Name()]
if !exists {
return
Expand All @@ -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.globalLock.Unlock()
}

// Refs gets the current list of refs for the given volume
Expand Down

0 comments on commit f531065

Please sign in to comment.