[ewg] [PATCH] RDMA/ucma.c: Fix for ucma context uid=0, causing iWarp RDMA applications to fail in connection establishment

Nikolova, Tatyana E tatyana.e.nikolova at intel.com
Tue Aug 7 15:45:40 PDT 2012


Hi Vlad,

Please, ignore this patch. 

I will send another patch with a fix for the same issue, which is also approved by Sean Hefty and submitted upstream.


-----Original Message-----
From: ewg-bounces at lists.openfabrics.org [mailto:ewg-bounces at lists.openfabrics.org] On Behalf Of Tatyana Nikolova
Sent: Thursday, August 02, 2012 7:32 PM
To: vlad at dev.mellanox.co.il
Cc: ewg at lists.openfabrics.org
Subject: [ewg] [PATCH] RDMA/ucma.c: Fix for ucma context uid=0, causing iWarp RDMA applications to fail in connection establishment

Fix for ucma context uid=0, causing iWarp RDMA applications to fail in connection establishment.

If the context uid is not set before calling rdma_accept(), the RDMA_CM_EVENT_ESTABLISHED event generated asynchronously by successfull rdma_accept ends up with zero ucma context uid, resulting in segfault at librdmacm.so 

Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova at intel.com>
---
 drivers/infiniband/core/ucma.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 8002ae6..6cc40de 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -803,9 +803,8 @@ static ssize_t ucma_accept(struct ucma_file *file, const char __user *inbuf,
 	if (cmd.conn_param.valid) {
 		ucma_copy_conn_param(&conn_param, &cmd.conn_param);
 		mutex_lock(&file->mut);
+		ctx->uid = cmd.uid;
 		ret = rdma_accept(ctx->cm_id, &conn_param);
-		if (!ret)
-			ctx->uid = cmd.uid;
 		mutex_unlock(&file->mut);
 	} else
 		ret = rdma_accept(ctx->cm_id, NULL);
-- 
1.7.4.2

_______________________________________________
ewg mailing list
ewg at lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg



More information about the ewg mailing list