From: Derrick Brashear Date: Mon, 21 Jan 2013 21:10:17 +0000 (-0500) Subject: darwin: stop processing upcalls once rx shutdown starts X-Git-Tag: upstream/1.8.0_pre1^2~1618 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ed8b4808860cda1f80403e372e540c63b3b4183c;p=packages%2Fo%2Fopenafs.git darwin: stop processing upcalls once rx shutdown starts we have a chicken and egg. can't stop upcall without killing socket; can't kill socket while rx might try to transmit on it. cheat, and if rx is shut down, don't process things upcall receives. FIXES 131577 Change-Id: I6b72f6e7aefb7937b768dcb9c0a83d0ee3317bfa Reviewed-on: http://gerrit.openafs.org/8931 Reviewed-by: Chas Williams - CONTRACTOR Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/rx/DARWIN/rx_knet.c b/src/rx/DARWIN/rx_knet.c index def2994d6..d0d0f797c 100644 --- a/src/rx/DARWIN/rx_knet.c +++ b/src/rx/DARWIN/rx_knet.c @@ -22,6 +22,8 @@ #endif #ifdef RXK_UPCALL_ENV +extern rx_atomic_t rxinit_status; + void rx_upcall(socket_t so, void *arg, __unused int waitflag) { @@ -38,6 +40,10 @@ rx_upcall(socket_t so, void *arg, __unused int waitflag) afs_int32 savelen; /* was using rlen but had aliasing problems */ size_t nbytes, resid, noffset; + /* we stopped rx but the socket isn't closed yet */ + if (rx_atomic_test_bit(&rxinit_status, 0)) + return; + /* See if a check for additional packets was issued */ rx_CheckPackets();