Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jul 2009 16:38:18 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195245 - head/sys/rpc
Message-ID:  <200907011638.n61GcIUM017951@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907011638.n61GcIUM017951>