From: Sean Hefty Date: Thu, 4 Oct 2012 18:49:59 +0000 (-0700) Subject: ucmatose: Fix number of connections to disconnect X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=11b3af684d8f4338d48d7238d431c791a89cffdd;p=~shefty%2Flibrdmacm.git ucmatose: Fix number of connections to disconnect When ucmatose aborts because of issues trying to connect to the server, it moves to disconnecting all connections. However, not all connections may have been established. The result is that ucmatose will hang in disconnect_events. Fix this by setting the number of times that we need to disconnect to the number of times that we successfully connect. This problem is based on a report by Doug Ledford Signed-off-by: Sean Hefty --- diff --git a/examples/cmatose.c b/examples/cmatose.c index 8ca2d88b..046d4522 100644 --- a/examples/cmatose.c +++ b/examples/cmatose.c @@ -212,7 +212,6 @@ static int post_sends(struct cmatest_node *node) static void connect_error(void) { - test.disconnects_left--; test.connects_left--; } @@ -324,6 +323,7 @@ static int cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) case RDMA_CM_EVENT_ESTABLISHED: ((struct cmatest_node *) cma_id->context)->connected = 1; test.connects_left--; + test.disconnects_left++; break; case RDMA_CM_EVENT_ADDR_ERROR: case RDMA_CM_EVENT_ROUTE_ERROR: @@ -704,7 +704,6 @@ int main(int argc, char **argv) } test.connects_left = connections; - test.disconnects_left = connections; test.channel = rdma_create_event_channel(); if (!test.channel) {