From owner-svn-src-head@FreeBSD.ORG Wed Jul 1 16:38:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF8F71065675; Wed, 1 Jul 2009 16:38:18 +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 DCBCA8FC08; Wed, 1 Jul 2009 16:38:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n61GcIGf017953; Wed, 1 Jul 2009 16:38:18 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n61GcIUM017951; Wed, 1 Jul 2009 16:38:18 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200907011638.n61GcIUM017951@svn.freebsd.org> From: Rick Macklem Date: Wed, 1 Jul 2009 16:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195245 - head/sys/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2009 16:38:19 -0000 Author: rmacklem Date: Wed Jul 1 16:38:18 2009 New Revision: 195245 URL: http://svn.freebsd.org/changeset/base/195245 Log: Make sure that cr_error is set to ESHUTDOWN when closing the connection. This is normally done by a loop in clnt_dg_close(), but requests that aren't in the pending queue at the time of closing, don't get set. This avoids a panic in xdrmbuf_create() when it is called with a NULL cr_mrep if cr_error doesn't get set to ESHUTDOWN while closing. Reviewed by: dfr Approved by: re (Ken Smith), kib (mentor) Modified: head/sys/rpc/clnt_dg.c Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Wed Jul 1 16:13:01 2009 (r195244) +++ head/sys/rpc/clnt_dg.c Wed Jul 1 16:38:18 2009 (r195245) @@ -547,11 +547,13 @@ get_reply: tv -= time_waited; if (tv > 0) { - if (cu->cu_closing || cu->cu_closed) + if (cu->cu_closing || cu->cu_closed) { error = 0; - else + cr->cr_error = ESHUTDOWN; + } else { error = msleep(cr, &cs->cs_lock, cu->cu_waitflag, cu->cu_waitchan, tv); + } } else { error = EWOULDBLOCK; }