summaryrefslogtreecommitdiff
path: root/ctdb/ib
diff options
context:
space:
mode:
authorPeter Somogyi <psomogyi@gamax.hu>2007-04-23 12:45:14 +0200
committerPeter Somogyi <psomogyi@gamax.hu>2007-04-23 12:45:14 +0200
commitd244415d1e4428aa39cc25082b7f691b461afb22 (patch)
tree0d2420ccc7a4bb61f75a19a7fa2d027b14423356 /ctdb/ib
parenteb20281bb423eb32e870dd78f8984e784b8aff67 (diff)
downloadsamba-d244415d1e4428aa39cc25082b7f691b461afb22.tar.gz
fixed ctdb/ib bug at reject event
reverted my suggestion in debug.c (based on my false error detection) (This used to be ctdb commit 5c52c9f37639c65b551c10d1706c49653cd99742)
Diffstat (limited to 'ctdb/ib')
-rw-r--r--ctdb/ib/ibwrapper.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/ctdb/ib/ibwrapper.c b/ctdb/ib/ibwrapper.c
index 908d38d5840..5aa2ca9c3c9 100644
--- a/ctdb/ib/ibwrapper.c
+++ b/ctdb/ib/ibwrapper.c
@@ -428,6 +428,7 @@ static void ibw_event_handler_cm(struct event_context *ev,
rc = rdma_get_cm_event(pctx->cm_channel, &event);
if (rc) {
ctx->state = IBWS_ERROR;
+ event = NULL;
sprintf(ibw_lasterr, "rdma_get_cm_event error %d\n", rc);
goto error;
}
@@ -520,9 +521,10 @@ static void ibw_event_handler_cm(struct event_context *ev,
if (conn) {
if ((rc=rdma_ack_cm_event(event)))
DEBUG(0, ("reject/rdma_ack_cm_event failed with %d\n", rc));
- event = NULL;
- pconn = talloc_get_type(conn->internal, struct ibw_conn_priv);
- ibw_conn_priv_destruct(pconn);
+ event = NULL; /* not to touch cma_id or conn */
+ conn->state = IBWC_ERROR;
+ /* it should free the conn */
+ pctx->connstate_func(NULL, conn);
}
goto error;
@@ -556,22 +558,26 @@ static void ibw_event_handler_cm(struct event_context *ev,
return;
error:
- if (event!=NULL && (rc=rdma_ack_cm_event(event))) {
- DEBUG(0, ("rdma_ack_cm_event failed with %d\n", rc));
- }
-
DEBUG(0, ("cm event handler: %s", ibw_lasterr));
- if (cma_id!=pctx->cm_id) {
- conn = talloc_get_type(cma_id->context, struct ibw_conn);
- if (conn) {
- conn->state = IBWC_ERROR;
- pctx->connstate_func(NULL, conn);
+ if (event!=NULL) {
+ if (cma_id!=NULL && cma_id!=pctx->cm_id) {
+ conn = talloc_get_type(cma_id->context, struct ibw_conn);
+ if (conn) {
+ conn->state = IBWC_ERROR;
+ pctx->connstate_func(NULL, conn);
+ }
+ } else {
+ ctx->state = IBWS_ERROR;
+ pctx->connstate_func(ctx, NULL);
+ }
+
+ if ((rc=rdma_ack_cm_event(event))!=0) {
+ DEBUG(0, ("rdma_ack_cm_event failed with %d\n", rc));
}
- } else {
- ctx->state = IBWS_ERROR;
- pctx->connstate_func(ctx, NULL);
}
+
+ return;
}
static void ibw_event_handler_verbs(struct event_context *ev,