Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Oct 2009 12:23:56 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r197955 - head/sys/netinet
Message-ID:  <200910111223.n9BCNuTp011104@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sun Oct 11 12:23:56 2009
New Revision: 197955
URL: http://svn.freebsd.org/changeset/base/197955

Log:
  Fix a race condition where a mutex was destroyed while sleeping on it.
  Found while analyzing a report from julian. It might fix his bug.
  Approved by: rrs (mentor)
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_bsd_addr.c
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_bsd_addr.c
==============================================================================
--- head/sys/netinet/sctp_bsd_addr.c	Sun Oct 11 11:00:14 2009	(r197954)
+++ head/sys/netinet/sctp_bsd_addr.c	Sun Oct 11 12:23:56 2009	(r197955)
@@ -97,6 +97,7 @@ sctp_iterator_thread(void *v)
 		    &SCTP_BASE_INFO(ipi_iterator_wq_mtx),
 		    0, "waiting_for_work", 0);
 		if (SCTP_BASE_INFO(threads_must_exit)) {
+			SCTP_IPI_ITERATOR_WQ_DESTROY();
 			kthread_exit();
 		}
 		sctp_iterator_worker();

Modified: head/sys/netinet/sctp_pcb.c
==============================================================================
--- head/sys/netinet/sctp_pcb.c	Sun Oct 11 11:00:14 2009	(r197954)
+++ head/sys/netinet/sctp_pcb.c	Sun Oct 11 12:23:56 2009	(r197955)
@@ -5616,7 +5616,6 @@ sctp_pcb_finish(void)
 	SCTP_IP_PKTLOG_DESTROY();
 
 #endif
-	SCTP_IPI_ITERATOR_WQ_DESTROY();
 	SCTP_IPI_ADDR_DESTROY();
 	SCTP_ITERATOR_LOCK_DESTROY();
 	SCTP_STATLOG_DESTROY();



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