Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933058Ab1CYX7N (ORCPT ); Fri, 25 Mar 2011 19:59:13 -0400 Received: from kroah.org ([198.145.64.141]:48952 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933035Ab1CYX62 (ORCPT ); Fri, 25 Mar 2011 19:58:28 -0400 X-Mailbox-Line: From gregkh@clark.kroah.org Fri Mar 25 16:56:38 2011 Message-Id: <20110325235638.646255911@clark.kroah.org> User-Agent: quilt/0.48-16.4 Date: Fri, 25 Mar 2011 16:55:58 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Trond Myklebust Subject: [21/23] SUNRPC: Never reuse the socket port after an xs_close() References: <20110325235537.660072281@clark.kroah.org> Content-Disposition: inline; filename=sunrpc-never-reuse-the-socket-port-after-an-xs_close.patch In-Reply-To: <20110325235654.GA24416@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 991 Lines: 33 From: Trond Myklebust commit 246408dcd5dfeef2df437ccb0ef4d6ee87805f58 upstream. If we call xs_close(), we're in one of two situations: - Autoclose, which means we don't expect to resend a request - bind+connect failed, which probably means the port is in use Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- net/sunrpc/xprtsock.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -743,6 +743,8 @@ static void xs_reset_transport(struct so if (sk == NULL) return; + transport->srcport = 0; + write_lock_bh(&sk->sk_callback_lock); transport->inet = NULL; transport->sock = NULL; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/