linux/net/rxrpc
Willem de Bruijn 364a9e9324 sock: deduplicate errqueue dequeue
sk->sk_error_queue is dequeued in four locations. All share the
exact same logic. Deduplicate.

Also collapse the two critical sections for dequeue (at the top of
the recv handler) and signal (at the bottom).

This moves signal generation for the next packet forward, which should
be harmless.

It also changes the behavior if the recv handler exits early with an
error. Previously, a signal for follow-up packets on the errqueue
would then not be scheduled. The new behavior, to always signal, is
arguably a bug fix.

For rxrpc, the change causes the same function to be called repeatedly
for each queued packet (because the recv handler == sk_error_report).
It is likely that all packets will fail for the same reason (e.g.,
memory exhaustion).

This code runs without sk_lock held, so it is not safe to trust that
sk->sk_err is immutable inbetween releasing q->lock and the subsequent
test. Introduce int err just to avoid this potential race.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-09-01 21:49:08 -07:00
..
af_rxrpc.c af_rxrpc: Add sysctls for configuring RxRPC parameters 2014-02-26 17:25:06 +00:00
ar-accept.c
ar-ack.c af_rxrpc: Expose more RxRPC parameters via sysctls 2014-02-26 17:25:07 +00:00
ar-call.c af_rxrpc: Keep rxrpc_call pointers in a hashtable 2014-03-04 10:36:53 +00:00
ar-connection.c af_rxrpc: Add sysctls for configuring RxRPC parameters 2014-02-26 17:25:06 +00:00
ar-connevent.c
ar-error.c sock: deduplicate errqueue dequeue 2014-09-01 21:49:08 -07:00
ar-input.c net: remove dead code after sk_data_ready change 2014-08-22 21:08:50 -07:00
ar-internal.h net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
ar-key.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-08-06 09:38:14 -07:00
ar-local.c
ar-output.c af_rxrpc: Request an ACK for every alternate DATA packet 2014-02-26 17:25:07 +00:00
ar-peer.c
ar-proc.c
ar-recvmsg.c af_rxrpc: Remove incorrect checksum calculation from rxrpc_recvmsg() 2014-02-07 18:58:43 +00:00
ar-security.c
ar-skbuff.c af_rxrpc: Improve ACK production 2014-02-26 17:25:07 +00:00
ar-transport.c af_rxrpc: Add sysctls for configuring RxRPC parameters 2014-02-26 17:25:06 +00:00
Kconfig
Makefile af_rxrpc: Add sysctls for configuring RxRPC parameters 2014-02-26 17:25:06 +00:00
rxkad.c
sysctl.c af_rxrpc: Expose more RxRPC parameters via sysctls 2014-02-26 17:25:07 +00:00