Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Nov 2003 12:04:27 -0600 (CST)
From:      Mike Silbersack <silby@silby.com>
To:        Sam Leffler <sam@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/netinet tcp_syncache.c
Message-ID:  <20031111120300.Y16061@odysseus.silby.com>
In-Reply-To: <200311111754.hABHslNG062585@repoman.freebsd.org>
References:  <200311111754.hABHslNG062585@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tue, 11 Nov 2003, Sam Leffler wrote:

> sam         2003/11/11 09:54:47 PST
>
>   FreeBSD src repository
>
>   Modified files:
>     sys/netinet          tcp_syncache.c
>   Log:
>   o add missing inpcb locking in tcp_respond
>   o replace spl's with lock assertions
>
>   Supported by:   FreeBSD Foundation

Part of this looks goofy to me:

@@ -377,14 +374,12 @@ syncache_timer(xslot)
 	intptr_t slot = (intptr_t)xslot;
 	struct syncache *sc, *nsc;
 	struct inpcb *inp;
-	int s;

-	s = splnet();
 	INP_INFO_WLOCK(&tcbinfo);
         if (callout_pending(&tcp_syncache.tt_timerq[slot]) ||
             !callout_active(&tcp_syncache.tt_timerq[slot])) {
-		INP_INFO_WUNLOCK(&tcbinfo);
-                splx(s);
+		/* XXX can this happen? */
+		INP_INFO_WLOCK(&tcbinfo);
                 return;
         }
         callout_deactivate(&tcp_syncache.tt_timerq[slot]);
@@ -421,8 +416,7 @@ syncache_timer(xslot)
 	if (nsc != NULL)
 		callout_reset(&tcp_syncache.tt_timerq[slot],
 		    nsc->sc_rxttime - ticks, syncache_timer, (void
*)(slot));
-	INP_INFO_WUNLOCK(&tcbinfo);
-	splx(s);
+	INP_INFO_WLOCK(&tcbinfo);
 }

Shouldn't those WUNLOCK calls stay as WUNLOCK?

Mike "Silby" Silbersack



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031111120300.Y16061>