mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
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)
This commit is contained in:
parent
eb20281bb4
commit
d244415d1e
@ -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,
|
||||
|
@ -30,12 +30,12 @@ void do_debug(const char *format, ...)
|
||||
char *s = NULL;
|
||||
|
||||
va_start(ap, format);
|
||||
s = talloc_vasprintf(NULL, format, ap);
|
||||
vasprintf(&s, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
gettimeofday(&tm, NULL);
|
||||
printf("%-8.8d.%-6.6d [%d]: %s", (int)tm.tv_sec, (int)tm.tv_usec,
|
||||
(int)getpid(), s);
|
||||
fflush(stdout);
|
||||
talloc_free(s);
|
||||
free(s);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user