fs: dlm: handle possible othercon writequeues
authorAlexander Aring <aahringo@redhat.com>
Thu, 27 Aug 2020 19:02:53 +0000 (15:02 -0400)
committerDavid Teigland <teigland@redhat.com>
Thu, 27 Aug 2020 20:59:09 +0000 (15:59 -0500)
This patch adds free of possible other writequeue entries in othercon
member of struct connection.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lowcomms.c

index 04afc71..794216e 100644 (file)
@@ -1608,11 +1608,13 @@ static void shutdown_conn(struct connection *con)
 static void free_conn(struct connection *con)
 {
        close_connection(con, true, true, true);
-       if (con->othercon)
-               kfree_rcu(con->othercon, rcu);
        spin_lock(&connections_lock);
        hlist_del_rcu(&con->list);
        spin_unlock(&connections_lock);
+       if (con->othercon) {
+               clean_one_writequeue(con->othercon);
+               kfree_rcu(con->othercon, rcu);
+       }
        clean_one_writequeue(con);
        kfree_rcu(con, rcu);
 }