From d0587baa07fc8ed8769319b6e96f509c82d4a5c3 Mon Sep 17 00:00:00 2001 From: pschwan Date: Wed, 2 Oct 2002 18:56:27 +0000 Subject: [PATCH] - Comment out put_connection until we resolve the dep issue - Can c ever be NULL in ptlrpc_put_connection? I don't know, but I want to find out. --- lustre/obdclass/genops.c | 9 +++++---- lustre/ptlrpc/connection.c | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index ee32fdb..57e37e8 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -352,7 +352,7 @@ struct obd_export *class_new_export(struct obd_device *obddev) struct obd_export * export; export = kmem_cache_alloc(export_cachep, GFP_KERNEL); - if ( !export ) { + if (!export) { CERROR("no memory! (minor %d)\n", obddev->obd_minor); return NULL; } @@ -384,7 +384,7 @@ void class_destroy_export(struct obd_export *exp) list_del(&exp->exp_conn_chain); if (exp->exp_connection) { spin_unlock(&exp->exp_connection->c_lock); - ptlrpc_put_connection(exp->exp_connection); + //ptlrpc_put_connection(exp->exp_connection); } kmem_cache_free(export_cachep, exp); @@ -415,7 +415,7 @@ int class_connect(struct lustre_handle *conn, struct obd_device *obd, conn->addr = (__u64) (unsigned long)export; conn->cookie = export->exp_cookie; - + CDEBUG(D_IOCTL, "connect: addr %Lx cookie %Lx\n", (long long)conn->addr, (long long)conn->cookie); return 0; @@ -535,7 +535,8 @@ int class_multi_cleanup(struct obd_device *obddev) for (i = 0; i < obddev->obd_multi_count; i++) { int rc; - struct obd_device *obd = class_conn2obd(&obddev->obd_multi_conn[i]); + struct obd_device *obd = + class_conn2obd(&obddev->obd_multi_conn[i]); if (!obd) { CERROR("no such device [i %d]\n", i); diff --git a/lustre/ptlrpc/connection.c b/lustre/ptlrpc/connection.c index 7a1d47b..0307ecb 100644 --- a/lustre/ptlrpc/connection.c +++ b/lustre/ptlrpc/connection.c @@ -109,6 +109,11 @@ int ptlrpc_put_connection(struct ptlrpc_connection *c) int rc = 0; ENTRY; + if (c == NULL) { + CERROR("NULL connection\n"); + RETURN(0); + } + CDEBUG(D_INFO, "connection=%p refcount %d\n", c, atomic_read(&c->c_refcount) - 1); if (atomic_dec_and_test(&c->c_refcount)) { -- 1.8.3.1