From 8cb8cd4cc5722b720ab41a7dd3c42af06b0331f1 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 17 Nov 2020 16:59:48 -0800 Subject: [PATCH] add locks --- weed/topology/volume_layout.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.go index ffe36e95b..4c9c84459 100644 --- a/weed/topology/volume_layout.go +++ b/weed/topology/volume_layout.go @@ -132,6 +132,8 @@ func NewVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, volumeSi } func (vl *VolumeLayout) String() string { + vl.accessLock.RLock() + defer vl.accessLock.RUnlock() return fmt.Sprintf("rp:%v, ttl:%v, vid2location:%v, writables:%v, volumeSizeLimit:%v", vl.rp, vl.ttl, vl.vid2location, vl.writables, vl.volumeSizeLimit) }