From owner-svn-src-all@FreeBSD.ORG Wed Jun 10 19:02:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D35901065672; Wed, 10 Jun 2009 19:02:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1BAF8FC14; Wed, 10 Jun 2009 19:02:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5AJ29nf022961; Wed, 10 Jun 2009 19:02:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5AJ29fe022960; Wed, 10 Jun 2009 19:02:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906101902.n5AJ29fe022960@svn.freebsd.org> From: Rick Macklem Date: Wed, 10 Jun 2009 19:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193942 - head/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2009 19:02:10 -0000 Author: rmacklem Date: Wed Jun 10 19:02:09 2009 New Revision: 193942 URL: http://svn.freebsd.org/changeset/base/193942 Log: 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) Modified: head/sys/rpc/clnt_rc.c Modified: head/sys/rpc/clnt_rc.c ============================================================================== --- head/sys/rpc/clnt_rc.c Wed Jun 10 18:27:15 2009 (r193941) +++ head/sys/rpc/clnt_rc.c Wed Jun 10 19:02:09 2009 (r193942) @@ -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);