Whamcloud - gitweb
- Fix two leaks
authorpschwan <pschwan>
Fri, 14 Jun 2002 23:36:50 +0000 (23:36 +0000)
committerpschwan <pschwan>
Fri, 14 Jun 2002 23:36:50 +0000 (23:36 +0000)
- Fix mknod regression
- Fixed one connection leak

lustre/ldlm/ldlm_lockd.c
lustre/llite/namei.c
lustre/llite/super.c
lustre/mds/handler.c
lustre/osc/osc_request.c
lustre/ost/ost_handler.c
lustre/ptlrpc/client.c
lustre/ptlrpc/connection.c
lustre/tests/llmountcleanup.sh

index 980f8b2..dcd6943 100644 (file)
@@ -330,6 +330,8 @@ static int ldlm_iocontrol(long cmd, struct obd_conn *conn, int len, void *karg,
                 RETURN(-EINVAL);
         }
 
+        OBD_ALLOC(obddev->u.ldlm.ldlm_client,
+                  sizeof(*obddev->u.ldlm.ldlm_client));
         ptlrpc_init_client(NULL, NULL,
                            LDLM_REQUEST_PORTAL, LDLM_REPLY_PORTAL,
                            obddev->u.ldlm.ldlm_client);
@@ -350,6 +352,8 @@ static int ldlm_iocontrol(long cmd, struct obd_conn *conn, int len, void *karg,
  out:
         if (connection)
                 ptlrpc_put_connection(connection);
+        OBD_FREE(obddev->u.ldlm.ldlm_client,
+                 sizeof(*obddev->u.ldlm.ldlm_client));
         return err;
 }
 
@@ -403,7 +407,6 @@ static int ldlm_cleanup(struct obd_device *obddev)
                 CERROR("Request list not empty!\n");
         }
 
-        OBD_FREE(ldlm->ldlm_client, sizeof(*ldlm->ldlm_client));
         OBD_FREE(ldlm->ldlm_service, sizeof(*ldlm->ldlm_service));
 
         if (mds_reint_p != NULL)
index 87166e2..f08914f 100644 (file)
@@ -148,7 +148,7 @@ static struct dentry *ll_lookup2(struct inode * dir, struct dentry *dentry,
         err = ll_lock(dir, dentry, it, &lockh);
         memcpy(it->it_lock_handle, &lockh, sizeof(lockh));
 
-        if ( (it->it_op & (IT_CREAT | IT_MKDIR | IT_SYMLINK)) &&
+        if ( (it->it_op & (IT_CREAT | IT_MKDIR | IT_SYMLINK | IT_MKNOD)) &&
              it->it_disposition && !it->it_status)
                 GOTO(negative, NULL);
 
index 484f9de..8ea85d5 100644 (file)
@@ -232,6 +232,7 @@ static void ll_put_super(struct super_block *sb)
         ll_commitcbd_cleanup(sbi);
         obd_disconnect(&sbi->ll_osc_conn);
         obd_disconnect(&sbi->ll_mdc_conn);
+        OBD_FREE(sbi, sizeof(*sbi));
 
         MOD_DEC_USE_COUNT;
         EXIT;
index b2742b5..9505a15 100644 (file)
@@ -976,6 +976,9 @@ static int mds_cleanup(struct obd_device * obddev)
         ldlm_namespace_free(mds->mds_local_namespace);
         ldlm_namespace_free(obddev->obd_namespace);
 
+        if (mds->mds_ldlm_conn != NULL)
+                ptlrpc_put_connection(mds->mds_ldlm_conn);
+
         OBD_FREE(mds->mds_ldlm_client, sizeof(*mds->mds_ldlm_client));
 
         lock_kernel();
index 55526f0..deb82cb 100644 (file)
@@ -473,7 +473,7 @@ static int osc_brw_read(struct obd_conn *conn, obd_count num_oa,
                 struct ptlrpc_bulk_page *bulk;
                 bulk = list_entry(tmp, struct ptlrpc_bulk_page, b_link);
                 if (bulk->b_buf != NULL)
-                        kunmap(bulk->b_page);
+                        kunmap(bulk->b_buf);
         }
         ptlrpc_free_bulk(desc);
  out2:
index 98e0874..d1b0e55 100644 (file)
@@ -694,6 +694,8 @@ static int ost_cleanup(struct obd_device * obddev)
                 RETURN(-EINVAL);
         }
 
+        ldlm_namespace_free(obddev->obd_namespace);
+
         MOD_DEC_USE_COUNT;
         RETURN(0);
 }
index 07b3f6d..4e2a138 100644 (file)
@@ -214,8 +214,11 @@ void ptlrpc_req_finished(struct ptlrpc_request *request)
 
 void ptlrpc_free_req(struct ptlrpc_request *request)
 {
-        if (request == NULL)
+        ENTRY;
+        if (request == NULL) {
+                EXIT;
                 return;
+        }
 
         if (request->rq_repmsg != NULL)
                 OBD_FREE(request->rq_repmsg, request->rq_replen);
@@ -231,6 +234,7 @@ void ptlrpc_free_req(struct ptlrpc_request *request)
         ptlrpc_put_connection(request->rq_connection);
 
         OBD_FREE(request, sizeof(*request));
+        EXIT;
 }
 
 static int ptlrpc_check_reply(struct ptlrpc_request *req)
index 992815d..10cd9ca 100644 (file)
@@ -92,7 +92,7 @@ int ptlrpc_put_connection(struct ptlrpc_connection *c)
                 rc = 1;
         }
         if (atomic_read(&c->c_refcount) < 0)
-                CERROR("refcount < 0 for connection %p!\n", c);
+                CDEBUG(D_INFO, "refcount < 0 for connection %p!\n", c);
 
         RETURN(rc);
 }
index 7287d68..0448d31 100755 (executable)
@@ -68,6 +68,9 @@ EOF
 
 rmmod kqswnal
 rmmod ksocknal
+
+$DBGCTL debug_kernel /tmp/debug.3.$TIME 1
+
 rmmod portals
 
 losetup -d ${LOOP}0