Skip to content

Commit

Permalink
rxrpc: Fix overwaking on call poking
Browse files Browse the repository at this point in the history
If an rxrpc call is given a poke, it will get woken up unconditionally,
even if there's already a poke pending (for which there will have been a
wake) or if the call refcount has gone to 0.

Fix this by only waking the call if it is still referenced and if it
doesn't already have a poke pending.

Fixes: 15f661d ("rxrpc: Implement a mechanism to send an event notification to a call")
Signed-off-by: David Howells <[email protected]>
cc: Marc Dionne <[email protected]>
cc: [email protected]
  • Loading branch information
dhowells committed Feb 7, 2023
1 parent 16d5677 commit a33395a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/rxrpc/call_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ void rxrpc_poke_call(struct rxrpc_call *call, enum rxrpc_call_poke_trace what)
spin_lock_bh(&local->lock);
busy = !list_empty(&call->attend_link);
trace_rxrpc_poke_call(call, busy, what);
if (!busy && !rxrpc_try_get_call(call, rxrpc_call_get_poke))
busy = true;
if (!busy) {
rxrpc_get_call(call, rxrpc_call_get_poke);
list_add_tail(&call->attend_link, &local->call_attend_q);
}
spin_unlock_bh(&local->lock);
rxrpc_wake_up_io_thread(local);
if (!busy)
rxrpc_wake_up_io_thread(local);
}
}

Expand Down

0 comments on commit a33395a

Please sign in to comment.