mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-23 22:09:16 +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 {
|
||||
for _, dn := range vl.vid2location[vid].list {
|
||||
if v, getError := dn.GetVolumesById(vid); getError == nil {
|
||||
if v.ReadOnly {
|
||||
return false
|
||||
if location, ok := vl.vid2location[vid]; ok {
|
||||
for _, dn := range location.list {
|
||||
if v, getError := dn.GetVolumesById(vid); getError == nil {
|
||||
if v.ReadOnly {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user