From owner-svn-src-stable@FreeBSD.ORG Sun Nov 15 19:26:07 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37F601065676; Sun, 15 Nov 2009 19:26:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CB4C8FC1B; Sun, 15 Nov 2009 19:26:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAFJQ6CJ045984; Sun, 15 Nov 2009 19:26:06 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAFJQ6jf045982; Sun, 15 Nov 2009 19:26:06 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200911151926.nAFJQ6jf045982@svn.freebsd.org> From: Rick Macklem Date: Sun, 15 Nov 2009 19:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199293 - stable/8/sys/rpc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Nov 2009 19:26:07 -0000 Author: rmacklem Date: Sun Nov 15 19:26:06 2009 New Revision: 199293 URL: http://svn.freebsd.org/changeset/base/199293 Log: MFC: r199053 Add a check for the connection being shut down to the krpc client just before queuing a request for the connection. The code already had a check for the connection being shut down while the request was queued, but not one for the shut down having been initiated by the server before the request was in the queue. This fixes some cases of problems w.r.t. reconnecting to a NFS server that drops inactive TCP connections. Tested by: Olaf Seibert, Daniel Braniss Reviewed by: dfr Modified: stable/8/sys/rpc/clnt_vc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/rpc/clnt_vc.c ============================================================================== --- stable/8/sys/rpc/clnt_vc.c Sun Nov 15 18:31:57 2009 (r199292) +++ stable/8/sys/rpc/clnt_vc.c Sun Nov 15 19:26:06 2009 (r199293) @@ -413,6 +413,22 @@ call_again: cr->cr_xid = xid; mtx_lock(&ct->ct_lock); + /* + * Check to see if the other end has already started to close down + * the connection. The upcall will have set ct_error.re_status + * to RPC_CANTRECV if this is the case. + * If the other end starts to close down the connection after this + * point, it will be detected later when cr_error is checked, + * since the request is in the ct_pending queue. + */ + if (ct->ct_error.re_status == RPC_CANTRECV) { + if (errp != &ct->ct_error) { + errp->re_errno = ct->ct_error.re_errno; + errp->re_status = RPC_CANTRECV; + } + stat = RPC_CANTRECV; + goto out; + } TAILQ_INSERT_TAIL(&ct->ct_pending, cr, cr_link); mtx_unlock(&ct->ct_lock);