]> Pileus Git - ~andy/linux/blobdiff - fs/dlm/lowcomms.c
[DLM] Clear othercon pointers when a connection is closed
[~andy/linux] / fs / dlm / lowcomms.c
index 73d44f57e24a0e7870c28a59481c3a952f561ebf..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);
@@ -728,7 +730,7 @@ static int tcp_accept_from_sock(struct connection *con)
                else {
                        printk("Extra connection from node %d attempted\n", nodeid);
                        result = -EAGAIN;
-                       up_write(&newcon->sock_sem);
+                       mutex_unlock(&newcon->sock_mutex);
                        goto accept_err;
                }
        }
@@ -1449,7 +1451,7 @@ int dlm_lowcomms_start(void)
        error = -ENOMEM;
        con_cache = kmem_cache_create("dlm_conn", sizeof(struct connection),
                                      __alignof__(struct connection), 0,
-                                     NULL, NULL);
+                                     NULL);
        if (!con_cache)
                goto out;