소스 검색

Merge pull request #19779 from sillyousu/19777-fix-volume-store-dereference-deadlock

fix dead lock in volume store dereference
Brian Goff 9 년 전
부모
커밋
c17d4b4ebb
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      volume/store/store.go

+ 1 - 1
volume/store/store.go

@@ -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
@@ -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