]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
dapl: evd_alloc doesn't check for direct_object_create errors.
authorArlin Davis <arlin.r.davis@intel.com>
Tue, 22 Apr 2008 19:55:13 +0000 (12:55 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Tue, 22 Apr 2008 19:55:13 +0000 (12:55 -0700)
Fix error check in dapls_ib_wait_object_create() and dat_evd_alloc.
When attempting to create large number of evd's that exceed
open files limit the error was not propagated up causing
a segfault. Note: there are 3 FD's required for each EVD
2 for pipe, and one for cq event_channel.

Change the error reporting to indicate correct return
code and send to log with non-debug builds.

Signed-off by: Arlin Davis ardavis@ichips.intel.com

dapl/common/dapl_evd_util.c
dapl/openib_cma/dapl_ib_cq.c
dapl/openib_cma/dapl_ib_util.h

index 2ae1b59c4c32e6c180d35fe866c85f9cb1c02015..32fbabad164db8d334f087f060e9f08cb5a47a7a 100755 (executable)
@@ -301,6 +301,11 @@ dapls_evd_alloc (
            ((evd_flags & ~ (DAT_EVD_DTO_FLAG|DAT_EVD_RMR_BIND_FLAG)) == 0 ))
     {
         dapls_ib_wait_object_create (evd_ptr, &evd_ptr->cq_wait_obj_handle);
+       if (evd_ptr->cq_wait_obj_handle == NULL) {
+               dapl_os_free(evd_ptr, sizeof (DAPL_EVD));
+               evd_ptr = NULL;
+               goto bail;
+       }
     }
 #endif
 
index f63c9a786d94d4486e25a1a28eab7c3d795142f5..d7b3309d2878573f655c1142844fc685307db342 100755 (executable)
@@ -239,7 +239,7 @@ dapls_ib_cq_alloc(IN DAPL_IA *ia_ptr,
                                              channel, 0);
        
        if (evd_ptr->ib_cq_handle == IB_INVALID_HANDLE) 
-               return  DAT_INSUFFICIENT_RESOURCES;
+               return(dapl_convert_errno(errno,"create_cq"));
 
        /* arm cq for events */
        dapls_set_cq_notify(ia_ptr, evd_ptr);
@@ -458,7 +458,7 @@ dapls_ib_wait_object_create(IN DAPL_EVD *evd_ptr,
 bail:
        dapl_os_free(*p_cq_wait_obj_handle, 
                     sizeof(struct _ib_wait_obj_handle));
-
+       *p_cq_wait_obj_handle = NULL;
        return(dapl_convert_errno(errno," wait_object_create"));
 }
 
index 370f3b118497e734629ef7be9706a8c53d59cf1d..71593fda2764ed111f6b4060550ca14a345c8d31 100755 (executable)
@@ -305,11 +305,9 @@ dapl_convert_errno( IN int err, IN const char *str )
 {
     if (!err)  return DAT_SUCCESS;
        
-#if DAPL_DBG
     if ((err != EAGAIN) && (err != ETIME) && 
        (err != ETIMEDOUT) && (err != EINTR))
-       dapl_dbg_log (DAPL_DBG_TYPE_ERR," %s %s\n", str, strerror(err));
-#endif 
+       dapl_log (DAPL_DBG_TYPE_ERR," %s %s\n", str, strerror(err));
 
     switch( err )
     {