From owner-cvs-src-old@FreeBSD.ORG Thu Jun 4 14:49:44 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E69D91065673 for ; Thu, 4 Jun 2009 14:49:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D27208FC0A for ; Thu, 4 Jun 2009 14:49:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n54Eni0f089541 for ; Thu, 4 Jun 2009 14:49:44 GMT (envelope-from rmacklem@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n54Enid3089540 for cvs-src-old@freebsd.org; Thu, 4 Jun 2009 14:49:44 GMT (envelope-from rmacklem@repoman.freebsd.org) Message-Id: <200906041449.n54Enid3089540@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to rmacklem@repoman.freebsd.org using -f From: Rick Macklem Date: Thu, 4 Jun 2009 14:49:27 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/rpc clnt_dg.c clnt_vc.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 14:49:45 -0000 rmacklem 2009-06-04 14:49:27 UTC FreeBSD src repository Modified files: sys/rpc clnt_dg.c clnt_vc.c Log: SVN rev 193437 on 2009-06-04 14:49:27Z by rmacklem Fix upcall races in the client side krpc. For the client side upcall, holding SOCKBUF_LOCK() isn't sufficient to guarantee that there is no upcall in progress, since SOCKBUF_LOCK() is released/re-acquired in the upcall. An upcall reference counter was added to the upcall structure that is incremented at the beginning of the upcall and decremented at the end of the upcall. As such, a reference count == 0 when holding the SOCKBUF_LOCK() guarantees there is no upcall in progress. Add a function that is called just after soupcall_clear(), which waits until the reference count == 0. Also, move the mtx_destroy() down to after soupcall_clear(), so that the mutex is not destroyed before upcalls are done. Reviewed by: dfr, jhb Tested by: pho Approved by: kib (mentor) Revision Changes Path 1.6 +26 -1 src/sys/rpc/clnt_dg.c 1.7 +27 -2 src/sys/rpc/clnt_vc.c