Whamcloud - gitweb
- Add some more verbose logging of the cases that get clients into recovery.
[fs/lustre-release.git] / lustre / ptlrpc / connection.c
index 7a1d47b..07b46eb 100644 (file)
@@ -91,6 +91,7 @@ struct ptlrpc_connection *ptlrpc_get_connection(struct lustre_peer *peer,
         INIT_LIST_HEAD(&c->c_dying_head);
         INIT_LIST_HEAD(&c->c_imports);
         INIT_LIST_HEAD(&c->c_exports);
+        INIT_LIST_HEAD(&c->c_sb_chain);
         atomic_set(&c->c_refcount, 0);
         ptlrpc_connection_addref(c);
         spin_lock_init(&c->c_lock);
@@ -109,6 +110,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)) {