mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 07:19:23 +08:00
avoid nil locations
fix https://github.com/chrislusf/seaweedfs/issues/2059
This commit is contained in:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user