rxrpc: Fix some missing _bh annotations on locking conn->state_lock
authorDavid Howells <dhowells@redhat.com>
Thu, 1 Oct 2020 10:57:40 +0000 (11:57 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 5 Oct 2020 15:34:32 +0000 (16:34 +0100)
conn->state_lock may be taken in softirq mode, but a previous patch
replaced an outer lock in the response-packet event handling code, and lost
the _bh from that when doing so.

Fix this by applying the _bh annotation to the state_lock locking.

Fixes: a1399f8bb033 ("rxrpc: Call channels should have separate call number spaces")
Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/conn_event.c

index 447f55ca688605f372e382e71b20a6fd1628519a..6e972b4823efaea73eb4c95f5bbe377c42326f65 100644 (file)
@@ -340,18 +340,18 @@ static int rxrpc_process_event(struct rxrpc_connection *conn,
                        return ret;
 
                spin_lock(&conn->channel_lock);
-               spin_lock(&conn->state_lock);
+               spin_lock_bh(&conn->state_lock);
 
                if (conn->state == RXRPC_CONN_SERVICE_CHALLENGING) {
                        conn->state = RXRPC_CONN_SERVICE;
-                       spin_unlock(&conn->state_lock);
+                       spin_unlock_bh(&conn->state_lock);
                        for (loop = 0; loop < RXRPC_MAXCALLS; loop++)
                                rxrpc_call_is_secure(
                                        rcu_dereference_protected(
                                                conn->channels[loop].call,
                                                lockdep_is_held(&conn->channel_lock)));
                } else {
-                       spin_unlock(&conn->state_lock);
+                       spin_unlock_bh(&conn->state_lock);
                }
 
                spin_unlock(&conn->channel_lock);