summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-03-03 05:47:33 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-03-04 00:41:00 -0800
commit8f132b363d41e7fe94a8712ed297a5f810e8ed56 (patch)
tree18cd6c294c0eb585ca1ac4da479f79f2926b162c /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parent568d4027033a5cb89d6aaee757d4c71e5369fe25 (diff)
glusterd: check for the variable before dereferencing it
check if 'peerinfo->mgmt' is set (ie, handshake is completed), before sending any request to that peer. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2486 ([glusterfs-3.1.3qa2]: Core generated due to SegFault in glusterd_sm.c) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2486
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index fc8f86ac8a3..c994db40c12 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -4609,7 +4609,7 @@ glusterd_op_ac_send_lock (glusterd_op_sm_event_t *event, void *ctx)
(glusterd_op_get_op() != GD_OP_SYNC_VOLUME))
continue;
- proc = &peerinfo->mgmt->proctable[GD_MGMT_CLUSTER_LOCK];
+ proc = &peerinfo->mgmt->proctable[GLUSTERD_MGMT_CLUSTER_LOCK];
if (proc->fn) {
ret = proc->fn (NULL, this, peerinfo);
if (ret)
@@ -4654,7 +4654,7 @@ glusterd_op_ac_send_unlock (glusterd_op_sm_event_t *event, void *ctx)
(glusterd_op_get_op() != GD_OP_SYNC_VOLUME))
continue;
- proc = &peerinfo->mgmt->proctable[GD_MGMT_CLUSTER_UNLOCK];
+ proc = &peerinfo->mgmt->proctable[GLUSTERD_MGMT_CLUSTER_UNLOCK];
if (proc->fn) {
ret = proc->fn (NULL, this, peerinfo);
if (ret)
@@ -4868,7 +4868,7 @@ glusterd_op_ac_send_stage_op (glusterd_op_sm_event_t *event, void *ctx)
(glusterd_op_get_op() != GD_OP_SYNC_VOLUME))
continue;
- proc = &peerinfo->mgmt->proctable[GD_MGMT_STAGE_OP];
+ proc = &peerinfo->mgmt->proctable[GLUSTERD_MGMT_STAGE_OP];
GF_ASSERT (proc);
if (proc->fn) {
ret = dict_set_static_ptr (dict, "peerinfo", peerinfo);
@@ -4989,7 +4989,7 @@ glusterd_op_ac_send_commit_op (glusterd_op_sm_event_t *event, void *ctx)
(glusterd_op_get_op() != GD_OP_SYNC_VOLUME))
continue;
- proc = &peerinfo->mgmt->proctable[GD_MGMT_COMMIT_OP];
+ proc = &peerinfo->mgmt->proctable[GLUSTERD_MGMT_COMMIT_OP];
GF_ASSERT (proc);
if (proc->fn) {
ret = dict_set_static_ptr (dict, "peerinfo", peerinfo);