[DLM] Clear othercon pointers when a connection is closed
authorPatrick Caulfield <pcaulfie@redhat.com>
Wed, 11 Jul 2007 12:39:43 +0000 (13:39 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Tue, 14 Aug 2007 09:28:05 +0000 (10:28 +0100)
This patch clears the othercon pointer and frees the memory when a connnection
is closed. This could cause a small memory leak when nodes leave the cluster.

Signed-Off-By: Patrick Caulfield <pcaulfie@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/dlm/lowcomms.c

index dd362739d291e8a5d125ec2d2172e19d497bdecc..d15fd5f9f5c562f17f9a275a2c7646c948d72a83 100644 (file)
@@ -327,6 +327,8 @@ static void close_connection(struct connection *con, bool and_other)
        if (con->othercon && and_other) {
                /* Will only re-enter once. */
                close_connection(con->othercon, false);
+               kmem_cache_free(con_cache, con->othercon);
+               con->othercon = NULL;
        }
        if (con->rx_page) {
                __free_page(con->rx_page);