mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-25 05:43:19 +08:00
fix panic at isAllWritable (#5457)
fix panic https://github.com/seaweedfs/seaweedfs/issues/5456
This commit is contained in:
parent
2a88da4de7
commit
d5d8b8e2ae
@ -234,13 +234,18 @@ func (vl *VolumeLayout) ensureCorrectWritables(vid needle.VolumeId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (vl *VolumeLayout) isAllWritable(vid needle.VolumeId) bool {
|
func (vl *VolumeLayout) isAllWritable(vid needle.VolumeId) bool {
|
||||||
for _, dn := range vl.vid2location[vid].list {
|
if location, ok := vl.vid2location[vid]; ok {
|
||||||
|
for _, dn := range location.list {
|
||||||
if v, getError := dn.GetVolumesById(vid); getError == nil {
|
if v, getError := dn.GetVolumesById(vid); getError == nil {
|
||||||
if v.ReadOnly {
|
if v.ReadOnly {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user