tcp_syncache.hashbase should be zero cleared before calling mtx_init()

From: YAMAMOTO Shigeru <shigeru_at_iij.ad.jp>
Date: Tue, 20 Jun 2006 09:55:38 +0900 (JST)
Hi, all,

When I testing -current, my pc panic at booting time.
Message is 'lock "tcp_sc_head" XXXX already initialized'.

So, I read _at_src/sys/netinet/tcp_syncache.c.
It seems me that 'tcp_syncache.hashbase' should be zero cleared before
calling,

    289                 mtx_init(&tcp_syncache.hashbase[i].sch_mtx, "tcp_sc_head
    289 ",
    290                          NULL, MTX_DEF);

Is it right?

Thanks,
-------
YAMAMOTO Shigeru	<shigeru_at_iij.ad.jp>

P.S.
currently, I'm using following local patch.

Index: sys/netinet/tcp_syncache.c
===================================================================
RCS file: /share/cvsup/FreeBSD/current/usr/src/sys/netinet/tcp_syncache.c,v
retrieving revision 1.92
diff -u -r1.92 tcp_syncache.c
--- sys/netinet/tcp_syncache.c	18 Jun 2006 13:03:42 -0000	1.92
+++ sys/netinet/tcp_syncache.c	19 Jun 2006 03:01:00 -0000
_at__at_ -281,7 +281,7 _at__at_
 	/* Allocate the hash table. */
 	MALLOC(tcp_syncache.hashbase, struct syncache_head *,
 	    tcp_syncache.hashsize * sizeof(struct syncache_head),
-	    M_SYNCACHE, M_WAITOK);
+	    M_SYNCACHE, M_WAITOK | M_ZERO);
 
 	/* Initialize the hash buckets. */
 	for (i = 0; i < tcp_syncache.hashsize; i++) {
Received on Mon Jun 19 2006 - 22:55:43 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:57 UTC