summaryrefslogtreecommitdiffstats
path: root/sys/rpc
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2009-06-10 19:02:09 +0000
committerrmacklem <rmacklem@FreeBSD.org>2009-06-10 19:02:09 +0000
commit6e30b78167fc4eae3fac9e9348416692c401f276 (patch)
tree47217174a720ff714eeec10f9907d0a99601bfc9 /sys/rpc
parentd5b1c989db5b483fe2477ae36578b86fdf9c463b (diff)
downloadFreeBSD-src-6e30b78167fc4eae3fac9e9348416692c401f276.zip
FreeBSD-src-6e30b78167fc4eae3fac9e9348416692c401f276.tar.gz
For the case where another thread was doing a connect and that
connect failed, the thread would be left stuck in msleep() indefinitely, since it would call msleep() again for the case where rc_client == NULL. Change the loop criteria and the if just after the loop, so that this case is handled correctly. Reviewed by: dfr Approved by: kib (mentor)
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/clnt_rc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/rpc/clnt_rc.c b/sys/rpc/clnt_rc.c
index 48d9495..03f21b8 100644
--- a/sys/rpc/clnt_rc.c
+++ b/sys/rpc/clnt_rc.c
@@ -154,7 +154,7 @@ again:
return (RPC_CANTSEND);
}
if (rc->rc_connecting) {
- while (!rc->rc_closed && !rc->rc_client) {
+ while (!rc->rc_closed && !rc->rc_client && rc->rc_connecting) {
error = msleep(rc, &rc->rc_lock,
rc->rc_intr ? PCATCH : 0, "rpcrecon", 0);
if (error) {
@@ -166,7 +166,7 @@ again:
* If the other guy failed to connect, we might as
* well have another go.
*/
- if (!rc->rc_client && !rc->rc_connecting)
+ if (!rc->rc_client || rc->rc_closed)
goto again;
mtx_unlock(&rc->rc_lock);
return (RPC_SUCCESS);
OpenPOWER on IntegriCloud