svn commit: r195245 - head/sys/rpc
Rick Macklem
rmacklem at FreeBSD.org
Wed Jul 1 16:38:19 UTC 2009
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;
}
More information about the svn-src-head
mailing list