mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
avoid nil locations
fix https://github.com/chrislusf/seaweedfs/issues/2059
This commit is contained in:
parent
da0a4e775b
commit
9a6aa00e9d
|
@ -49,7 +49,12 @@ func (t *Topology) SetVolumeCapacityFull(volumeInfo *storage.VolumeInfo) bool {
|
||||||
vl.accessLock.RLock()
|
vl.accessLock.RLock()
|
||||||
defer vl.accessLock.RUnlock()
|
defer vl.accessLock.RUnlock()
|
||||||
|
|
||||||
for _, dn := range vl.vid2location[volumeInfo.Id].list {
|
vidLocations, found := vl.vid2location[volumeInfo.Id]
|
||||||
|
if !found {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, dn := range vidLocations.list {
|
||||||
if !volumeInfo.ReadOnly {
|
if !volumeInfo.ReadOnly {
|
||||||
|
|
||||||
disk := dn.getOrCreateDisk(volumeInfo.DiskType)
|
disk := dn.getOrCreateDisk(volumeInfo.DiskType)
|
||||||
|
|
Loading…
Reference in a new issue