From b766fabd9caa769d25d02444e1c9c54a0d4924ee Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Wed, 1 Jul 2009 16:38:18 +0000 Subject: 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) --- sys/rpc/clnt_dg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/rpc/clnt_dg.c b/sys/rpc/clnt_dg.c index 865c704be5a7..0b49375b993a 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; } -- cgit v1.3