Rev 93: ctdb/ib fork bugfix in http://samba.org/~tridge/psomogyi/

psomogyi at gamax.hu psomogyi at gamax.hu
Wed May 2 15:30:05 GMT 2007


------------------------------------------------------------
revno: 93
revision-id: psomogyi at gamax.hu-20070502152756-cgv2olqgrryuhpvq
parent: psomogyi at gamax.hu-20070502151948-im6i33gzv36dnqyl
committer: Peter Somogyi <psomogyi at gamax.hu>
branch nick: ctdb
timestamp: Wed 2007-05-02 17:27:56 +0200
message:
  ctdb/ib fork bugfix
  - added ibv_fork_init not to have exotic errors after forks (even if ib is not used at all in children)
modified:
  ib/ibwrapper.c                 ibwrapper.c-20061204130028-0125b4f5a72f4b11
=== modified file 'ib/ibwrapper.c'
--- a/ib/ibwrapper.c	2007-05-02 15:19:48 +0000
+++ b/ib/ibwrapper.c	2007-05-02 15:27:56 +0000
@@ -534,13 +534,14 @@
 
 	case RDMA_CM_EVENT_DISCONNECTED:
 		DEBUG(11, ("RDMA_CM_EVENT_DISCONNECTED\n"));
-		if ((rc=rdma_ack_cm_event(event)))
-			DEBUG(0, ("disc/rdma_ack_cm_event failed with %d\n", rc));
-		event = NULL; /* don't ack more */
-
 		if (cma_id!=pctx->cm_id) {
-			DEBUG(0, ("client DISCONNECT event cm_id=%p\n", cma_id));
+			DEBUG(1, ("client DISCONNECT event cm_id=%p\n", cma_id));
 			conn = talloc_get_type(cma_id->context, struct ibw_conn);
+
+			if ((rc=rdma_ack_cm_event(event)))
+				DEBUG(0, ("disc/rdma_ack_cm_event failed with %d\n", rc));
+			event = NULL; /* don't ack it any more */
+
 			conn->state = IBWC_DISCONNECTED;
 			pctx->connstate_func(NULL, conn);
 		}
@@ -945,6 +946,13 @@
 
 	DEBUG(10, ("ibw_init(ctx_userdata: %p, ectx: %p)\n", ctx_userdata, ectx));
 
+	rc = ibv_fork_init();
+	if (rc) {
+		sprintf(ibw_lasterr,
+			"FATAL ERROR: ibv_fork_init returned with %d\n", rc);
+		goto error;
+	}
+
 	/* initialize basic data structures */
 	memset(ibw_lasterr, 0, IBW_LASTERR_BUFSIZE);
 
@@ -965,13 +973,13 @@
 
 	/* process attributes */
 	if (ibw_process_init_attrs(attr, nattr, &pctx->opts))
-		goto cleanup;
+		goto error;
 
 	/* init cm */
 	pctx->cm_channel = rdma_create_event_channel();
 	if (!pctx->cm_channel) {
 		sprintf(ibw_lasterr, "rdma_create_event_channel error %d\n", errno);
-		goto cleanup;
+		goto error;
 	}
 
 	pctx->cm_channel_event = event_add_fd(pctx->ectx, pctx,
@@ -985,7 +993,7 @@
 	if (rc) {
 		rc = errno;
 		sprintf(ibw_lasterr, "rdma_create_id error %d\n", rc);
-		goto cleanup;
+		goto error;
 	}
 	DEBUG(10, ("created cm_id %p\n", pctx->cm_id));
 
@@ -993,7 +1001,7 @@
 
 	return ctx;
 	/* don't put code here */
-cleanup:
+error:
 	DEBUG(0, (ibw_lasterr));
 
 	if (ctx)



More information about the samba-cvs mailing list