mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: netdev@vger.kernel.org
Cc: dhowells@redhat.com, linux-afs@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net-next 06/14] rxrpc: Purge the to_be_accepted queue on socket release
Date: Sun, 18 Sep 2016 00:18:26 +0100	[thread overview]
Message-ID: <147415430646.17897.4833203211143872574.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <147415426459.17897.13899206413543061473.stgit@warthog.procyon.org.uk>

Purge the queue of to_be_accepted calls on socket release.  Note that
purging sock_calls doesn't release the ref owned by to_be_accepted.

Probably the sock_calls list is redundant given a purges of the recvmsg_q,
the to_be_accepted queue and the calls tree.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 net/rxrpc/call_object.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c
index 22f9b0d1a138..b0ffbd9664e6 100644
--- a/net/rxrpc/call_object.c
+++ b/net/rxrpc/call_object.c
@@ -476,6 +476,16 @@ void rxrpc_release_calls_on_socket(struct rxrpc_sock *rx)
 
 	_enter("%p", rx);
 
+	while (!list_empty(&rx->to_be_accepted)) {
+		call = list_entry(rx->to_be_accepted.next,
+				  struct rxrpc_call, accept_link);
+		list_del(&call->accept_link);
+		rxrpc_abort_call("SKR", call, 0, RX_CALL_DEAD, ECONNRESET);
+		rxrpc_send_call_packet(call, RXRPC_PACKET_TYPE_ABORT);
+		rxrpc_release_call(rx, call);
+		rxrpc_put_call(call, rxrpc_call_put);
+	}
+
 	while (!list_empty(&rx->sock_calls)) {
 		call = list_entry(rx->sock_calls.next,
 				  struct rxrpc_call, sock_link);

  parent reply	other threads:[~2016-09-17 23:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-17 23:17 [PATCH net-next 00/14] rxrpc: Fixes & miscellany David Howells
2016-09-17 23:17 ` [PATCH net-next 01/14] rxrpc: Remove some whitespace David Howells
2016-09-17 23:17 ` [PATCH net-next 02/14] rxrpc: Move the check of rx_pkt_offset from rxrpc_locate_data() to caller David Howells
2016-09-17 23:18 ` [PATCH net-next 03/14] rxrpc: Check the return value of rxrpc_locate_data() David Howells
2016-09-17 23:18 ` [PATCH net-next 04/14] rxrpc: Fix handling of the last packet in rxrpc_recvmsg_data() David Howells
2016-09-17 23:18 ` [PATCH net-next 05/14] rxrpc: Record calls that need to be accepted David Howells
2016-09-17 23:18 ` David Howells [this message]
2016-09-17 23:18 ` [PATCH net-next 07/14] rxrpc: Fix the putting of client connections David Howells
2016-09-17 23:18 ` [PATCH net-next 08/14] rxrpc: Call rxrpc_release_call() on error in rxrpc_new_client_call() David Howells
2016-09-17 23:18 ` [PATCH net-next 09/14] rxrpc: Fix unexposed client conn release David Howells
2016-09-17 23:18 ` [PATCH net-next 10/14] rxrpc: Fix the parsing of soft-ACKs David Howells
2016-09-17 23:19 ` [PATCH net-next 11/14] rxrpc: Fix retransmission algorithm David Howells
2016-09-17 23:19 ` [PATCH net-next 12/14] rxrpc: Don't transmit an ACK if there's no reason set David Howells
2016-09-17 23:19 ` [PATCH net-next 13/14] rxrpc: Be consistent about switch value in rxrpc_send_call_packet() David Howells
2016-09-17 23:19 ` [PATCH net-next 14/14] rxrpc: Fix the basic transmit DATA packet content size at 1412 bytes David Howells
2016-09-18 11:22 ` [PATCH net-next 00/14] rxrpc: Fixes & miscellany David Miller
2016-09-19  5:53 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=147415430646.17897.4833203211143872574.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®