]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: dlm: set subclass for othercon sock_mutex
authorAlexander Aring <aahringo@redhat.com>
Mon, 1 Mar 2021 22:05:11 +0000 (17:05 -0500)
committerDavid Teigland <teigland@redhat.com>
Tue, 9 Mar 2021 14:56:42 +0000 (08:56 -0600)
This patch sets the lockdep subclass for the othercon socket mutex. In
various places the connection socket mutex is held while locking the
othercon socket mutex. This patch will remove lockdep warnings when such
case occurs.

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

index f169e35d19f42641f8e7d394f0a32be4d72bdfbe..ca9bf54b94a984327811c179b9cdda61e046465a 100644 (file)
@@ -934,13 +934,14 @@ static int accept_from_sock(struct listen_connection *con)
                                goto accept_err;
                        }
 
+                       lockdep_set_subclass(&othercon->sock_mutex, 1);
                        newcon->othercon = othercon;
                } else {
                        /* close other sock con if we have something new */
                        close_connection(othercon, false, true, false);
                }
 
-               mutex_lock_nested(&othercon->sock_mutex, 1);
+               mutex_lock(&othercon->sock_mutex);
                add_sock(newsock, othercon);
                addcon = othercon;
                mutex_unlock(&othercon->sock_mutex);