]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rxrpc: Remove some socket lock acquire/release annotations
authorDavid Howells <dhowells@redhat.com>
Fri, 11 Apr 2025 09:52:48 +0000 (10:52 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Apr 2025 00:36:41 +0000 (17:36 -0700)
Remove some socket lock acquire/release annotations as lock_sock() and
release_sock() don't have them and so the checker gets confused.  Removing
all of them, however, causes warnings about "context imbalance" and "wrong
count at exit" to occur instead.

Probably lock_sock() and release_sock() should have annotations on
indicating their taking of sk_lock - there is a dep_map in socket_lock_t,
but I don't know if that matters to the static checker.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20250411095303.2316168-4-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/rxrpc/ar-internal.h
net/rxrpc/call_object.c
net/rxrpc/sendmsg.c

index 55810c6b4be89715f7764d08619626456f067eac..c267b8ac1bb531d3c7adef81520a3ad43d12587b 100644 (file)
@@ -1000,7 +1000,9 @@ struct rxrpc_call *rxrpc_alloc_call(struct rxrpc_sock *, gfp_t, unsigned int);
 struct rxrpc_call *rxrpc_new_client_call(struct rxrpc_sock *,
                                         struct rxrpc_conn_parameters *,
                                         struct rxrpc_call_params *, gfp_t,
-                                        unsigned int);
+                                        unsigned int)
+       __releases(&rx->sk.sk_lock)
+       __acquires(&call->user_mutex);
 void rxrpc_start_call_timer(struct rxrpc_call *call);
 void rxrpc_incoming_call(struct rxrpc_sock *, struct rxrpc_call *,
                         struct sk_buff *);
index fce58be65e7cfc62ea7fa1f4271b8c4792cd973f..f428ea77f803c3cc4f2278e4d6ad74377293598d 100644 (file)
@@ -322,7 +322,7 @@ struct rxrpc_call *rxrpc_new_client_call(struct rxrpc_sock *rx,
                                         struct rxrpc_call_params *p,
                                         gfp_t gfp,
                                         unsigned int debug_id)
-       __releases(&rx->sk.sk_lock.slock)
+       __releases(&rx->sk.sk_lock)
        __acquires(&call->user_mutex)
 {
        struct rxrpc_call *call, *xcall;
index 3f62c34ce7de14880e27f26d281a88a564c32d14..2342b5f1547cb9e04c5eaa3480f7ad647bc169a0 100644 (file)
@@ -607,7 +607,7 @@ static int rxrpc_sendmsg_cmsg(struct msghdr *msg, struct rxrpc_send_params *p)
 static struct rxrpc_call *
 rxrpc_new_client_call_for_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg,
                                  struct rxrpc_send_params *p)
-       __releases(&rx->sk.sk_lock.slock)
+       __releases(&rx->sk.sk_lock)
        __acquires(&call->user_mutex)
 {
        struct rxrpc_conn_parameters cp;
@@ -657,7 +657,6 @@ rxrpc_new_client_call_for_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg,
  * - the socket may be either a client socket or a server socket
  */
 int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
-       __releases(&rx->sk.sk_lock.slock)
 {
        struct rxrpc_call *call;
        bool dropped_lock = false;