[openib-general] Re: ib_uat kernel panic without async callback

Hal Rosenstock halr at voltaire.com
Wed Jul 20 05:35:16 PDT 2005


On Wed, 2005-07-20 at 07:30, Hal Rosenstock wrote:
> On Tue, 2005-07-19 at 14:42, Arlin Davis wrote:
> > Yes, it returns the route data (GID) when the return == 1.  However, I 
> > still get a callback event with a req_id ==0 which is somewhat 
> > unexpected. This seems unnecessary given that ib_at_route_by_ip() just 
> > returned the data. Is this the expected behavior?
> > 
> > Here is my output from the call and from the at_thread.
> > 
> > 4116 Running as client
> > 4116 Server Name: iclust-20-ib0
> > 4116 Server Net Address: 192.168.0.20
> > dapl_ep_connect (0x515c40, {4294967232.4294967208.0.20}, 115D3, 5000000, 
> > 0, (nil), 0, 0)
> >  connect: r_SID 71123, pdata (nil), plen 0
> >  connect: at_route ret=1, req_id 0, GID fe80000000000000 
> > 0002c90200004071   <<<< ib_route info returned with call
> > dapl_ep_connect () returns 0x0
> > 4116 Waiting for connect response
> > 
> > at_thread: get_callback
> >  rt_comp_handler: conn 0x519e30, req_id 0 rec_num 1                 
> >  rt_comp_handler: SRC GID subnet fe80000000000000 id 0002c9020000409d    
> > <<< get_callback event fires
> >  rt_comp_handler: DST GID subnet fe80000000000000 id 0002c90200004071
> >  at_thread: callback woke
> 
> Try this incremental patch:

This is v2 of this incremental patch:

Index: uat.c
===================================================================
--- uat.c	(revision 2884)
+++ uat.c	(working copy)
@@ -29,7 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- * $Id:$
+ * $Id$
  */
 #include <linux/init.h>
 #include <linux/fs.h>
@@ -276,9 +276,12 @@ static ssize_t ib_uat_route_by_ip(struct
 		if (copy_to_user(ctx->user_ib_route, ctx->ib_route,
 				 sizeof(*ctx->user_ib_route))) {
 			result = -EFAULT;
+			kfree(ctx->ib_route);
+			ib_uat_ctx_put(ctx);
 			goto err3;
 		}
-		ib_uat_route_callback(ctx->req_id, ctx, result);
+		kfree(ctx->ib_route);
+		ib_uat_ctx_put(ctx);
 	} else if (result < 0) {
 		ib_uat_ctx_put(ctx);
 		goto err3;
@@ -374,9 +377,12 @@ static ssize_t ib_uat_paths_by_route(str
 		if (copy_to_user(ctx->user_path_arr, ctx->path_arr,
 				 ctx->user_length)) {
 			result = -EFAULT;
+			kfree(ctx->path_arr);
+			ib_uat_ctx_put(ctx);
 			goto err3;
 		}
-		ib_uat_path_callback(ctx->req_id, ctx, result);
+		kfree(ctx->path_arr);
+		ib_uat_ctx_put(ctx);
 	} else if (result < 0) {
 		ib_uat_ctx_put(ctx);
 		goto err3;
@@ -469,9 +475,12 @@ static ssize_t ib_uat_ips_by_gid(struct 
 		/* Copy IP addresses back to userspace */
 		if (copy_to_user(ctx->user_ips, ctx->ips, ctx->user_length)) {
 			result = -EFAULT;
+			kfree(ctx->ips);
+			ib_uat_ctx_put(ctx);
 			goto err3;
 		}
-		ib_uat_ips_callback(ctx->req_id, ctx, result);
+		kfree(ctx->ips);
+		ib_uat_ctx_put(ctx);
 	} else if (result < 0) {
 		ib_uat_ctx_put(ctx);
 		goto err3;






More information about the general mailing list