WSL2-Linux-Kernel/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
..
Kconfig net/rxrpc: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:40:02 -08:00
Makefile af_rxrpc: Add sysctls for configuring RxRPC parameters 2014-02-26 17:25:06 +00:00
af_rxrpc.c af_rxrpc: Add sysctls for configuring RxRPC parameters 2014-02-26 17:25:06 +00:00
ar-accept.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
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 rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection() 2011-05-19 18:35:58 -04:00
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 include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ar-output.c af_rxrpc: Request an ACK for every alternate DATA packet 2014-02-26 17:25:07 +00:00
ar-peer.c net/rxrpc/ar-peer.c: remove invalid reference to list iterator variable 2012-07-09 15:24:33 -07:00
ar-proc.c net: replace NIPQUAD() in net/*/ 2008-10-31 00:54:56 -07:00
ar-recvmsg.c af_rxrpc: Remove incorrect checksum calculation from rxrpc_recvmsg() 2014-02-07 18:58:43 +00:00
ar-security.c RxRPC: Allow key payloads to be passed in XDR form 2009-09-15 02:44:23 -07:00
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
rxkad.c net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
sysctl.c af_rxrpc: Expose more RxRPC parameters via sysctls 2014-02-26 17:25:07 +00:00