On Tue, Dec 20, 2016 at 03:28:38PM +0100, Martin Pieuchot wrote: > I don't have a solution for the moment and I want to be sure we know all
Me neither. That's why I did not send a diff, but only the stack trace. > recursions before trying to write a fix. So here's a diff that mark the > recursions with a XXXSMP like in the NFS case. I think this approach is fine. > ok? You missed the returns in pflowioctl() between rw_exit_write() and rw_enter_write(). I would suggest that you follow the splnet() and put a rw_enter_write() after each splx(). bluhm > > Index: net/if_pflow.c > =================================================================== > RCS file: /cvs/src/sys/net/if_pflow.c,v > retrieving revision 1.62 > diff -u -p -r1.62 if_pflow.c > --- net/if_pflow.c 4 Oct 2016 13:54:32 -0000 1.62 > +++ net/if_pflow.c 20 Dec 2016 14:23:32 -0000 > @@ -267,7 +267,10 @@ pflow_clone_destroy(struct ifnet *ifp) > pflow_flush(sc); > m_freem(sc->send_nam); > if (sc->so != NULL) { > + /* XXXSMP breaks atomicity */ > + rw_exit_write(&netlock); > error = soclose(sc->so); > + rw_enter_write(&netlock); > sc->so = NULL; > } > if (sc->sc_flowdst != NULL) > @@ -375,6 +378,8 @@ pflowioctl(struct ifnet *ifp, u_long cmd > } > } > > + /* XXXSMP breaks atomicity */ > + rw_exit_write(&netlock); > s = splnet(); > pflow_flush(sc); > > @@ -530,6 +535,7 @@ pflowioctl(struct ifnet *ifp, u_long cmd > } else > ifp->if_flags &= ~IFF_RUNNING; > > + rw_enter_write(&netlock); > break; > > default: