Skip to content

Commit

Permalink
Revert "Merge pull request #1683 from qieqieplus/master"
Browse files Browse the repository at this point in the history
This reverts commit 8cb6795, reversing
changes made to 200e562.
  • Loading branch information
chrislusf committed Dec 17, 2020
1 parent 99990a3 commit 986cbdf
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions weed/storage/disk_location.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne
}

// avoid loading one volume more than once
l.volumesLock.Lock()
if _, found := l.volumes[vid]; found {
l.volumesLock.Unlock()
l.volumesLock.RLock()
_, found := l.volumes[vid]
l.volumesLock.RUnlock()
if found {
glog.V(1).Infof("loaded volume, %v", vid)
return true
} else {
l.volumes[vid] = nil
l.volumesLock.Unlock()
}

// load the volume
Expand All @@ -115,7 +113,7 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne
glog.V(0).Infof("new volume %s error %s", volumeName, e)
return false
}

l.SetVolume(vid, v)

size, _, _ := v.FileStat()
Expand Down

0 comments on commit 986cbdf

Please sign in to comment.