From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755965AbbFTB1O (ORCPT ); Fri, 19 Jun 2015 21:27:14 -0400 Received: from smtprelay0198.hostedemail.com ([216.40.44.198]:47717 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754796AbbFTB1K (ORCPT ); Fri, 19 Jun 2015 21:27:10 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::,RULES_HIT:41:69:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1434:1437:1515:1516:1518:1535:1543:1593:1594:1605:1711:1730:1747:1777:1792:2393:2553:2559:2562:2903:3138:3139:3140:3141:3142:3622:3834:3865:3866:3867:3868:3870:3871:3872:3874:4117:4250:4321:4362:4560:5007:6117:6119:6120:6261:7576:7875:7901:7903:9000:9040:9545:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12291:12296:12438:12517:12519:12555:12681:12683:12740:13161:13229:13868:14096:14097:14110:21063:21080:21088,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: knot68_5b7410d655e2a X-Filterd-Recvd-Size: 6055 Date: Fri, 19 Jun 2015 21:27:06 -0400 From: Steven Rostedt To: Trond Myklebust Cc: Jeff Layton , Eric Dumazet , Anna Schumaker , Linux NFS Mailing List , Linux Network Devel Mailing List , LKML , Andrew Morton , Bruce James Fields Subject: Re: [REGRESSION] NFS is creating a hidden port (left over from xs_bind() ) Message-ID: <20150619212706.2f13a44e@gandalf.local.home> In-Reply-To: <1434756359.8498.2.camel@primarydata.com> References: <20150611234929.7b48d314@gandalf.local.home> <1434120035.27504.77.camel@edumazet-glaptop2.roam.corp.google.com> <20150612113420.5c114183@gandalf.local.home> <20150612115038.44e20ccd@gandalf.local.home> <20150617230819.0a11e47a@grimm.local.home> <20150618154914.57424225@gandalf.local.home> <20150618185051.2b2828c3@tlielax.poochiereds.net> <20150618210843.4b09c31c@grimm.local.home> <20150618213702.33f64b20@synchrony.poochiereds.net> <20150619122553.43d2d86c@gandalf.local.home> <20150619131759.7b38d9de@gandalf.local.home> <20150619155226.7c5d6637@synchrony.poochiereds.net> <1434745818.8838.1.camel@primarydata.com> <20150619181440.22f54e6a@gandalf.local.home> <1434756359.8498.2.camel@primarydata.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 19 Jun 2015 19:25:59 -0400 Trond Myklebust wrote: > 8<-------------------------------------------------------------- > >From 4876cc779ff525b9c2376d8076edf47815e71f2c Mon Sep 17 00:00:00 2001 > From: Trond Myklebust > Date: Fri, 19 Jun 2015 16:17:57 -0400 > Subject: [PATCH v2] SUNRPC: Ensure we release the TCP socket once it has been > closed > > This fixes a regression introduced by commit caf4ccd4e88cf2 ("SUNRPC: > Make xs_tcp_close() do a socket shutdown rather than a sock_release"). > Prior to that commit, the autoclose feature would ensure that an > idle connection would result in the socket being both disconnected and > released, whereas now only gets disconnected. > > While the current behaviour is harmless, it does leave the port bound > until either RPC traffic resumes or the RPC client is shut down. Is there a way to test RPC traffic resuming? I'd like to try that before declaring this bug harmless. > > Reported-by: Steven Rostedt The problem appears to go away with this patch. Tested-by: Steven Rostedt Thanks a lot! -- Steve > Signed-off-by: Trond Myklebust > --- > net/sunrpc/xprt.c | 2 +- > net/sunrpc/xprtsock.c | 40 ++++++++++++++++++++++------------------ > 2 files changed, 23 insertions(+), 19 deletions(-) > > diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c > index 3ca31f20b97c..ab5dd621ae0c 100644 > --- a/net/sunrpc/xprt.c > +++ b/net/sunrpc/xprt.c > @@ -611,8 +611,8 @@ static void xprt_autoclose(struct work_struct *work) > struct rpc_xprt *xprt = > container_of(work, struct rpc_xprt, task_cleanup); > > - xprt->ops->close(xprt); > clear_bit(XPRT_CLOSE_WAIT, &xprt->state); > + xprt->ops->close(xprt); > xprt_release_write(xprt, NULL); > } > > diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c > index fda8ec8c74c0..ee0715dfc3c7 100644 > --- a/net/sunrpc/xprtsock.c > +++ b/net/sunrpc/xprtsock.c > @@ -623,24 +623,6 @@ process_status: > } > > /** > - * xs_tcp_shutdown - gracefully shut down a TCP socket > - * @xprt: transport > - * > - * Initiates a graceful shutdown of the TCP socket by calling the > - * equivalent of shutdown(SHUT_RDWR); > - */ > -static void xs_tcp_shutdown(struct rpc_xprt *xprt) > -{ > - struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); > - struct socket *sock = transport->sock; > - > - if (sock != NULL) { > - kernel_sock_shutdown(sock, SHUT_RDWR); > - trace_rpc_socket_shutdown(xprt, sock); > - } > -} > - > -/** > * xs_tcp_send_request - write an RPC request to a TCP socket > * @task: address of RPC task that manages the state of an RPC request > * > @@ -786,6 +768,7 @@ static void xs_sock_mark_closed(struct rpc_xprt *xprt) > xs_sock_reset_connection_flags(xprt); > /* Mark transport as closed and wake up all pending tasks */ > xprt_disconnect_done(xprt); > + xprt_force_disconnect(xprt); > } > > /** > @@ -2103,6 +2086,27 @@ out: > xprt_wake_pending_tasks(xprt, status); > } > > +/** > + * xs_tcp_shutdown - gracefully shut down a TCP socket > + * @xprt: transport > + * > + * Initiates a graceful shutdown of the TCP socket by calling the > + * equivalent of shutdown(SHUT_RDWR); > + */ > +static void xs_tcp_shutdown(struct rpc_xprt *xprt) > +{ > + struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); > + struct socket *sock = transport->sock; > + > + if (sock == NULL) > + return; > + if (xprt_connected(xprt)) { > + kernel_sock_shutdown(sock, SHUT_RDWR); > + trace_rpc_socket_shutdown(xprt, sock); > + } else > + xs_reset_transport(transport); > +} > + > static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) > { > struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Rostedt Subject: Re: [REGRESSION] NFS is creating a hidden port (left over from xs_bind() ) Date: Fri, 19 Jun 2015 21:27:06 -0400 Message-ID: <20150619212706.2f13a44e@gandalf.local.home> References: <20150611234929.7b48d314@gandalf.local.home> <1434120035.27504.77.camel@edumazet-glaptop2.roam.corp.google.com> <20150612113420.5c114183@gandalf.local.home> <20150612115038.44e20ccd@gandalf.local.home> <20150617230819.0a11e47a@grimm.local.home> <20150618154914.57424225@gandalf.local.home> <20150618185051.2b2828c3@tlielax.poochiereds.net> <20150618210843.4b09c31c@grimm.local.home> <20150618213702.33f64b20@synchrony.poochiereds.net> <20150619122553.43d2d86c@gandalf.local.home> <20150619131759.7b38d9de@gandalf.local.home> <20150619155226.7c5d6637@synchrony.poochiereds.net> <1434745818.8838.1.camel@primarydata.com> <20150619181440.22f54e6a@gandalf.local.home> <1434756359.8498.2.camel@primarydata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Jeff Layton , Eric Dumazet , Anna Schumaker , Linux NFS Mailing List , Linux Network Devel Mailing List , LKML , Andrew Morton , Bruce James Fields To: Trond Myklebust Return-path: In-Reply-To: <1434756359.8498.2.camel-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Fri, 19 Jun 2015 19:25:59 -0400 Trond Myklebust wrote: > 8<-------------------------------------------------------------- > >From 4876cc779ff525b9c2376d8076edf47815e71f2c Mon Sep 17 00:00:00 2001 > From: Trond Myklebust > Date: Fri, 19 Jun 2015 16:17:57 -0400 > Subject: [PATCH v2] SUNRPC: Ensure we release the TCP socket once it has been > closed > > This fixes a regression introduced by commit caf4ccd4e88cf2 ("SUNRPC: > Make xs_tcp_close() do a socket shutdown rather than a sock_release"). > Prior to that commit, the autoclose feature would ensure that an > idle connection would result in the socket being both disconnected and > released, whereas now only gets disconnected. > > While the current behaviour is harmless, it does leave the port bound > until either RPC traffic resumes or the RPC client is shut down. Is there a way to test RPC traffic resuming? I'd like to try that before declaring this bug harmless. > > Reported-by: Steven Rostedt The problem appears to go away with this patch. Tested-by: Steven Rostedt Thanks a lot! -- Steve > Signed-off-by: Trond Myklebust > --- > net/sunrpc/xprt.c | 2 +- > net/sunrpc/xprtsock.c | 40 ++++++++++++++++++++++------------------ > 2 files changed, 23 insertions(+), 19 deletions(-) > > diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c > index 3ca31f20b97c..ab5dd621ae0c 100644 > --- a/net/sunrpc/xprt.c > +++ b/net/sunrpc/xprt.c > @@ -611,8 +611,8 @@ static void xprt_autoclose(struct work_struct *work) > struct rpc_xprt *xprt = > container_of(work, struct rpc_xprt, task_cleanup); > > - xprt->ops->close(xprt); > clear_bit(XPRT_CLOSE_WAIT, &xprt->state); > + xprt->ops->close(xprt); > xprt_release_write(xprt, NULL); > } > > diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c > index fda8ec8c74c0..ee0715dfc3c7 100644 > --- a/net/sunrpc/xprtsock.c > +++ b/net/sunrpc/xprtsock.c > @@ -623,24 +623,6 @@ process_status: > } > > /** > - * xs_tcp_shutdown - gracefully shut down a TCP socket > - * @xprt: transport > - * > - * Initiates a graceful shutdown of the TCP socket by calling the > - * equivalent of shutdown(SHUT_RDWR); > - */ > -static void xs_tcp_shutdown(struct rpc_xprt *xprt) > -{ > - struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); > - struct socket *sock = transport->sock; > - > - if (sock != NULL) { > - kernel_sock_shutdown(sock, SHUT_RDWR); > - trace_rpc_socket_shutdown(xprt, sock); > - } > -} > - > -/** > * xs_tcp_send_request - write an RPC request to a TCP socket > * @task: address of RPC task that manages the state of an RPC request > * > @@ -786,6 +768,7 @@ static void xs_sock_mark_closed(struct rpc_xprt *xprt) > xs_sock_reset_connection_flags(xprt); > /* Mark transport as closed and wake up all pending tasks */ > xprt_disconnect_done(xprt); > + xprt_force_disconnect(xprt); > } > > /** > @@ -2103,6 +2086,27 @@ out: > xprt_wake_pending_tasks(xprt, status); > } > > +/** > + * xs_tcp_shutdown - gracefully shut down a TCP socket > + * @xprt: transport > + * > + * Initiates a graceful shutdown of the TCP socket by calling the > + * equivalent of shutdown(SHUT_RDWR); > + */ > +static void xs_tcp_shutdown(struct rpc_xprt *xprt) > +{ > + struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); > + struct socket *sock = transport->sock; > + > + if (sock == NULL) > + return; > + if (xprt_connected(xprt)) { > + kernel_sock_shutdown(sock, SHUT_RDWR); > + trace_rpc_socket_shutdown(xprt, sock); > + } else > + xs_reset_transport(transport); > +} > + > static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) > { > struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtprelay0198.hostedemail.com ([216.40.44.198]:47717 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754796AbbFTB1K (ORCPT ); Fri, 19 Jun 2015 21:27:10 -0400 Date: Fri, 19 Jun 2015 21:27:06 -0400 From: Steven Rostedt To: Trond Myklebust Cc: Jeff Layton , Eric Dumazet , Anna Schumaker , Linux NFS Mailing List , Linux Network Devel Mailing List , LKML , Andrew Morton , Bruce James Fields Subject: Re: [REGRESSION] NFS is creating a hidden port (left over from xs_bind() ) Message-ID: <20150619212706.2f13a44e@gandalf.local.home> In-Reply-To: <1434756359.8498.2.camel@primarydata.com> References: <20150611234929.7b48d314@gandalf.local.home> <1434120035.27504.77.camel@edumazet-glaptop2.roam.corp.google.com> <20150612113420.5c114183@gandalf.local.home> <20150612115038.44e20ccd@gandalf.local.home> <20150617230819.0a11e47a@grimm.local.home> <20150618154914.57424225@gandalf.local.home> <20150618185051.2b2828c3@tlielax.poochiereds.net> <20150618210843.4b09c31c@grimm.local.home> <20150618213702.33f64b20@synchrony.poochiereds.net> <20150619122553.43d2d86c@gandalf.local.home> <20150619131759.7b38d9de@gandalf.local.home> <20150619155226.7c5d6637@synchrony.poochiereds.net> <1434745818.8838.1.camel@primarydata.com> <20150619181440.22f54e6a@gandalf.local.home> <1434756359.8498.2.camel@primarydata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-nfs-owner@vger.kernel.org List-ID: On Fri, 19 Jun 2015 19:25:59 -0400 Trond Myklebust wrote: > 8<-------------------------------------------------------------- > >From 4876cc779ff525b9c2376d8076edf47815e71f2c Mon Sep 17 00:00:00 2001 > From: Trond Myklebust > Date: Fri, 19 Jun 2015 16:17:57 -0400 > Subject: [PATCH v2] SUNRPC: Ensure we release the TCP socket once it has been > closed > > This fixes a regression introduced by commit caf4ccd4e88cf2 ("SUNRPC: > Make xs_tcp_close() do a socket shutdown rather than a sock_release"). > Prior to that commit, the autoclose feature would ensure that an > idle connection would result in the socket being both disconnected and > released, whereas now only gets disconnected. > > While the current behaviour is harmless, it does leave the port bound > until either RPC traffic resumes or the RPC client is shut down. Is there a way to test RPC traffic resuming? I'd like to try that before declaring this bug harmless. > > Reported-by: Steven Rostedt The problem appears to go away with this patch. Tested-by: Steven Rostedt Thanks a lot! -- Steve > Signed-off-by: Trond Myklebust > --- > net/sunrpc/xprt.c | 2 +- > net/sunrpc/xprtsock.c | 40 ++++++++++++++++++++++------------------ > 2 files changed, 23 insertions(+), 19 deletions(-) > > diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c > index 3ca31f20b97c..ab5dd621ae0c 100644 > --- a/net/sunrpc/xprt.c > +++ b/net/sunrpc/xprt.c > @@ -611,8 +611,8 @@ static void xprt_autoclose(struct work_struct *work) > struct rpc_xprt *xprt = > container_of(work, struct rpc_xprt, task_cleanup); > > - xprt->ops->close(xprt); > clear_bit(XPRT_CLOSE_WAIT, &xprt->state); > + xprt->ops->close(xprt); > xprt_release_write(xprt, NULL); > } > > diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c > index fda8ec8c74c0..ee0715dfc3c7 100644 > --- a/net/sunrpc/xprtsock.c > +++ b/net/sunrpc/xprtsock.c > @@ -623,24 +623,6 @@ process_status: > } > > /** > - * xs_tcp_shutdown - gracefully shut down a TCP socket > - * @xprt: transport > - * > - * Initiates a graceful shutdown of the TCP socket by calling the > - * equivalent of shutdown(SHUT_RDWR); > - */ > -static void xs_tcp_shutdown(struct rpc_xprt *xprt) > -{ > - struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); > - struct socket *sock = transport->sock; > - > - if (sock != NULL) { > - kernel_sock_shutdown(sock, SHUT_RDWR); > - trace_rpc_socket_shutdown(xprt, sock); > - } > -} > - > -/** > * xs_tcp_send_request - write an RPC request to a TCP socket > * @task: address of RPC task that manages the state of an RPC request > * > @@ -786,6 +768,7 @@ static void xs_sock_mark_closed(struct rpc_xprt *xprt) > xs_sock_reset_connection_flags(xprt); > /* Mark transport as closed and wake up all pending tasks */ > xprt_disconnect_done(xprt); > + xprt_force_disconnect(xprt); > } > > /** > @@ -2103,6 +2086,27 @@ out: > xprt_wake_pending_tasks(xprt, status); > } > > +/** > + * xs_tcp_shutdown - gracefully shut down a TCP socket > + * @xprt: transport > + * > + * Initiates a graceful shutdown of the TCP socket by calling the > + * equivalent of shutdown(SHUT_RDWR); > + */ > +static void xs_tcp_shutdown(struct rpc_xprt *xprt) > +{ > + struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); > + struct socket *sock = transport->sock; > + > + if (sock == NULL) > + return; > + if (xprt_connected(xprt)) { > + kernel_sock_shutdown(sock, SHUT_RDWR); > + trace_rpc_socket_shutdown(xprt, sock); > + } else > + xs_reset_transport(transport); > +} > + > static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) > { > struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in