summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 18ac27e0fcb..f98c3b5102c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2919,10 +2919,13 @@ glusterd_get_quorum_cluster_counts (xlator_t *this, int *active_count,
*active_count = 1;
if (!peer_list) {
- cds_list_for_each_entry (peerinfo, &conf->peers, uuid_list) {
+ rcu_read_lock ();
+ cds_list_for_each_entry_rcu (peerinfo, &conf->peers,
+ uuid_list) {
glusterd_quorum_count(peerinfo, inquorum_count,
active_count, out);
}
+ rcu_read_unlock ();
} else {
if (_local_xaction_peers) {
list_for_each_local_xaction_peers (peerinfo,
@@ -8080,13 +8083,16 @@ glusterd_volume_rebalance_use_rsp_dict (dict_t *aggr, dict_t *rsp_dict)
node_uuid_str = gf_strdup (node_uuid);
/* Finding the index of the node-uuid in the peer-list */
- cds_list_for_each_entry (peerinfo, &conf->peers, uuid_list) {
+ rcu_read_lock ();
+ cds_list_for_each_entry_rcu (peerinfo, &conf->peers,
+ uuid_list) {
peer_uuid_str = gd_peer_uuid_str (peerinfo);
if (strcmp (peer_uuid_str, node_uuid_str) == 0)
break;
current_index++;
}
+ rcu_read_unlock ();
/* Setting the largest index value as the total count. */
ret = dict_get_int32 (ctx_dict, "count", &count);