diff options
| author | David Howells <dhowells@redhat.com> | 2022-10-12 15:42:06 +0100 |
|---|---|---|
| committer | David Howells <dhowells@redhat.com> | 2022-12-01 13:36:41 +0000 |
| commit | 29fb4ec385f18db98d9188c2173a0b07d2de6917 (patch) | |
| tree | 5421332d90da716ec1aaf36574cfe68af7f994e2 /net/rxrpc/peer_event.c | |
| parent | cf37b5987508878647161ec3cdba0bb00a1b607a (diff) | |
| download | linux-next-29fb4ec385f18db98d9188c2173a0b07d2de6917.tar.gz linux-next-29fb4ec385f18db98d9188c2173a0b07d2de6917.zip | |
rxrpc: Remove RCU from peer->error_targets list
Remove the RCU requirements from the peer's list of error targets so that
the error distributor can call sleeping functions.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Diffstat (limited to 'net/rxrpc/peer_event.c')
| -rw-r--r-- | net/rxrpc/peer_event.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/net/rxrpc/peer_event.c b/net/rxrpc/peer_event.c index 94f63fb1bd67..97d017ca3dc4 100644 --- a/net/rxrpc/peer_event.c +++ b/net/rxrpc/peer_event.c @@ -207,11 +207,24 @@ static void rxrpc_distribute_error(struct rxrpc_peer *peer, int error, enum rxrpc_call_completion compl) { struct rxrpc_call *call; + HLIST_HEAD(error_targets); + + spin_lock(&peer->lock); + hlist_move_list(&peer->error_targets, &error_targets); + + while (!hlist_empty(&error_targets)) { + call = hlist_entry(error_targets.first, + struct rxrpc_call, error_link); + hlist_del_init(&call->error_link); + spin_unlock(&peer->lock); - hlist_for_each_entry_rcu(call, &peer->error_targets, error_link) { rxrpc_see_call(call, rxrpc_call_see_distribute_error); rxrpc_set_call_completion(call, compl, 0, -error); + + spin_lock(&peer->lock); } + + spin_unlock(&peer->lock); } /* |
