mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(master): fix dead lock for flashnode
close:#22985995 Signed-off-by: chihe <chihe@oppo.com>
This commit is contained in:
parent
5e57eb1ecd
commit
12917180d4
@ -4145,12 +4145,13 @@ func (c *Cluster) allFlashNodes() (flashNodes []proto.NodeView) {
|
||||
flashNodes = make([]proto.NodeView, 0)
|
||||
c.flashNodeTopo.flashNodeMap.Range(func(addr, node interface{}) bool {
|
||||
flashNode := node.(*FlashNode)
|
||||
isWritable := flashNode.isWriteable()
|
||||
flashNode.RLock()
|
||||
flashNodes = append(flashNodes, proto.NodeView{
|
||||
ID: flashNode.ID,
|
||||
Addr: flashNode.Addr,
|
||||
Status: flashNode.IsActive,
|
||||
IsWritable: flashNode.isWriteable(),
|
||||
IsWritable: isWritable,
|
||||
})
|
||||
flashNode.RUnlock()
|
||||
return true
|
||||
|
||||
Loading…
Reference in New Issue
Block a user