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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 02d2cfb0932..03cebdc518a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2920,25 +2920,24 @@ glusterd_get_quorum_cluster_counts (xlator_t *this, int *active_count,
if (active_count)
*active_count = 1;
+ rcu_read_lock ();
if (!peer_list) {
- rcu_read_lock ();
cds_list_for_each_entry_rcu (peerinfo, &conf->peers,
uuid_list) {
- glusterd_quorum_count(peerinfo, inquorum_count,
+ GLUSTERD_QUORUM_COUNT(peerinfo, inquorum_count,
active_count, out);
}
- rcu_read_unlock ();
} else {
if (_local_xaction_peers) {
list_for_each_local_xaction_peers (peerinfo,
peer_list) {
- glusterd_quorum_count(peerinfo, inquorum_count,
+ GLUSTERD_QUORUM_COUNT(peerinfo, inquorum_count,
active_count, out);
}
} else {
cds_list_for_each_entry (peerinfo, peer_list,
op_peers_list) {
- glusterd_quorum_count(peerinfo, inquorum_count,
+ GLUSTERD_QUORUM_COUNT(peerinfo, inquorum_count,
active_count, out);
}
}
@@ -2959,6 +2958,8 @@ glusterd_get_quorum_cluster_counts (xlator_t *this, int *active_count,
*quorum_count = count;
ret = 0;
out:
+ rcu_read_unlock ();
+
return ret;
}