Re: Panic: witness_warn (r191682; shared rw udpinp (udpinp)...netinet6/udp6_usrreq.c:360)

From: Bruce Simpson <bms_at_incunabulum.net>
Date: Thu, 30 Apr 2009 22:43:26 +0100
David Wolfskill wrote:
> ...
> I believe that qualifies as Goodness, as I was able to use ssh to
> access the machine, so it's definitely up in multi-user mode.
>   


Hi,

Can you try this patch? This patch is probably more correct -- but you 
can see my intent was to avoid thrashing the INP lock on mcast delivery. 
INP lock use in that routine is goopy to read. That'll teach me to do 
things from memory for IPv4... bah! :-)


cheers
BMS

Index: udp6_usrreq.c
===================================================================
--- udp6_usrreq.c	(revision 191705)
+++ udp6_usrreq.c	(working copy)
_at__at_ -279,8 +279,6 _at__at_
 					continue;
 			}
 
-			INP_RLOCK(inp);
-
 			/*
 			 * Handle socket delivery policy for any-source
 			 * and source-specific multicast. [RFC3678]
_at__at_ -290,6 +288,8 _at__at_
 				struct sockaddr_in6	 mcaddr;
 				int			 blocked;
 
+				INP_RLOCK(inp);
+
 				bzero(&mcaddr, sizeof(struct sockaddr_in6));
 				mcaddr.sin6_len = sizeof(struct sockaddr_in6);
 				mcaddr.sin6_family = AF_INET6;
_at__at_ -304,9 +304,11 _at__at_
 					if (blocked == MCAST_NOTSMEMBER ||
 					    blocked == MCAST_MUTED)
 						UDPSTAT_INC(udps_filtermcast);
-					INP_RUNLOCK(inp);
+					INP_RUNLOCK(inp); /* XXX */
 					continue;
 				}
+
+				INP_RUNLOCK(inp);
 			}
 			if (last != NULL) {
 				struct mbuf *n;
_at__at_ -423,8 +425,6 _at__at_
 	return (IPPROTO_DONE);
 
 badheadlocked:
-	if (inp)
-		INP_RUNLOCK(inp);
 	INP_INFO_RUNLOCK(&V_udbinfo);
 badunlocked:
 	if (m)
Received on Thu Apr 30 2009 - 19:43:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:46 UTC