Date: Thu, 4 Jun 2009 14:49:27 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/rpc clnt_dg.c clnt_vc.c Message-ID: <200906041449.n54Enid3089540@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906041449.n54Enid3089540>