All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH v2 11/14] SUNRPC: Make xs_tcp_close() do a socket shutdown rather than a sock_release
Date: Mon,  9 Feb 2015 12:18:41 -0500	[thread overview]
Message-ID: <1423502324-25981-12-git-send-email-trond.myklebust@primarydata.com> (raw)
In-Reply-To: <1423502324-25981-11-git-send-email-trond.myklebust@primarydata.com>

Use of socket shutdown() means that we monitor the shutdown process
through the xs_tcp_state_change() callback, so it is preferable to
a full close in all cases unless we're destroying the transport.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 net/sunrpc/xprtsock.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 3d83cbd32ef2..0279e8ffb14a 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -857,10 +857,7 @@ static void xs_close(struct rpc_xprt *xprt)
 
 static void xs_tcp_close(struct rpc_xprt *xprt)
 {
-	if (test_and_clear_bit(XPRT_CONNECTION_CLOSE, &xprt->state))
-		xs_close(xprt);
-	else
-		xs_tcp_shutdown(xprt);
+	xs_tcp_shutdown(xprt);
 }
 
 static void xs_xprt_free(struct rpc_xprt *xprt)
@@ -1033,7 +1030,6 @@ static void xs_udp_data_ready(struct sock *sk)
  */
 static void xs_tcp_force_close(struct rpc_xprt *xprt)
 {
-	set_bit(XPRT_CONNECTION_CLOSE, &xprt->state);
 	xprt_force_disconnect(xprt);
 }
 
-- 
2.1.0


  reply	other threads:[~2015-02-09 17:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 17:18 [PATCH v2 00/14] Fix TCP connection port number reuse in NFSv3 Trond Myklebust
2015-02-09 17:18 ` [PATCH v2 01/14] SUNRPC: Set SO_REUSEPORT socket option for TCP connections Trond Myklebust
2015-02-09 17:18   ` [PATCH v2 02/14] SUNRPC: Handle EADDRINUSE on connect Trond Myklebust
2015-02-09 17:18     ` [PATCH v2 03/14] SUNRPC: Do not clear the source port in xs_reset_transport Trond Myklebust
2015-02-09 17:18       ` [PATCH v2 04/14] SUNRPC: Ensure xs_reset_transport() resets the close connection flags Trond Myklebust
2015-02-09 17:18         ` [PATCH v2 05/14] SUNRPC: Add helpers to prevent socket create from racing Trond Myklebust
2015-02-09 17:18           ` [PATCH v2 06/14] SUNRPC: TCP/UDP always close the old socket before reconnecting Trond Myklebust
2015-02-09 17:18             ` [PATCH v2 07/14] SUNRPC: Remove TCP client connection reset hack Trond Myklebust
2015-02-09 17:18               ` [PATCH v2 08/14] SUNRPC: Remove TCP socket linger code Trond Myklebust
2015-02-09 17:18                 ` [PATCH v2 09/14] SUNRPC: Cleanup to remove remaining uses of XPRT_CONNECTION_ABORT Trond Myklebust
2015-02-09 17:18                   ` [PATCH v2 10/14] SUNRPC: Ensure xs_tcp_shutdown() requests a full close of the connection Trond Myklebust
2015-02-09 17:18                     ` Trond Myklebust [this message]
2015-02-09 17:18                       ` [PATCH v2 12/14] SUNRPC: Remove the redundant XPRT_CONNECTION_CLOSE flag Trond Myklebust
2015-02-09 17:18                         ` [PATCH v2 13/14] SUNRPC: Handle connection reset more efficiently Trond Myklebust
2015-02-09 17:18                           ` [PATCH v2 14/14] SUNRPC: Define xs_tcp_fin_timeout only if CONFIG_SUNRPC_DEBUG Trond Myklebust

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=1423502324-25981-12-git-send-email-trond.myklebust@primarydata.com \
    --to=trond.myklebust@primarydata.com \
    --cc=linux-nfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.