summaryrefslogtreecommitdiffstats
path: root/sys/rpc
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2009-07-01 16:38:18 +0000
committerrmacklem <rmacklem@FreeBSD.org>2009-07-01 16:38:18 +0000
commitbad77de856a6138d1e3839ae0ac7a62a60e01332 (patch)
treebf40dbfed2c37cf1a245c427b2928d66e1e24011 /sys/rpc
parent15ba859ce279eb0f5962738c08f38b4d086914ab (diff)
downloadFreeBSD-src-bad77de856a6138d1e3839ae0ac7a62a60e01332.zip
FreeBSD-src-bad77de856a6138d1e3839ae0ac7a62a60e01332.tar.gz
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)
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/clnt_dg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/rpc/clnt_dg.c b/sys/rpc/clnt_dg.c
index 865c704..0b49375 100644
--- a/sys/rpc/clnt_dg.c
+++ b/sys/rpc/clnt_dg.c
@@ -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;
}
OpenPOWER on IntegriCloud