Date: Tue, 31 Dec 2019 21:41:46 -0500 From: Alexander Motin <mav@freebsd.org> To: koobs@freebsd.org Cc: src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head@freebsd.org Subject: Re: svn commit: r356240 - head/sys/netinet Message-ID: <CAO4K=PXWeWFMxS4ADneAuf6HuV%2B_zjoJDhwk7Y1zp1aU87zDCQ@mail.gmail.com> In-Reply-To: <ead44a08-d328-079d-f716-f3aa3f449183@FreeBSD.org> References: <201912311858.xBVIwUSh048909@repo.freebsd.org> <ead44a08-d328-079d-f716-f3aa3f449183@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, We hit it on 11.3. So I am going to MFC it. On Tue, Dec 31, 2019, 9:37 PM Kubilay Kocak <koobs@freebsd.org> wrote: > On 1/01/2020 5:58 am, Alexander Motin wrote: > > Author: mav > > Date: Tue Dec 31 18:58:29 2019 > > New Revision: 356240 > > URL: https://svnweb.freebsd.org/changeset/base/356240 > > > > Log: > > Relax locking of carp_forus(). > > > > This fixes deadlock between CARP and bridge. Bridge calls this > function > > taking CARP lock while holding bridge lock. Same time CARP tries to > send > > its announcements via the bridge while holding CARP lock. > > > > Use of CARP_LOCK() here does not solve anything, since sc_addr is > constant > > while race on sc_state is harmless and use of the lock does not close > it. > > > > Reviewed by: glebius > > MFC after: 2 weeks > > Sponsored by: iXsystems, Inc. > > > > Modified: > > head/sys/netinet/ip_carp.c > > > > Modified: head/sys/netinet/ip_carp.c > > > ============================================================================== > > --- head/sys/netinet/ip_carp.c Tue Dec 31 18:28:25 2019 > (r356239) > > +++ head/sys/netinet/ip_carp.c Tue Dec 31 18:58:29 2019 > (r356240) > > @@ -1230,14 +1230,15 @@ carp_forus(struct ifnet *ifp, u_char *dhost) > > > > CIF_LOCK(ifp->if_carp); > > IFNET_FOREACH_CARP(ifp, sc) { > > - CARP_LOCK(sc); > > + /* > > + * CARP_LOCK() is not here, since would protect nothing, > but > > + * cause deadlock with if_bridge, calling this under its > lock. > > + */ > > if (sc->sc_state == MASTER && !bcmp(dhost, > LLADDR(&sc->sc_addr), > > ETHER_ADDR_LEN)) { > > - CARP_UNLOCK(sc); > > CIF_UNLOCK(ifp->if_carp); > > return (1); > > } > > - CARP_UNLOCK(sc); > > } > > CIF_UNLOCK(ifp->if_carp); > > > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > > > Hi Alexander, > > Is this a only-head-impacted fix, or does the issue impact stable/12,11 > too, warranting MFC ? >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAO4K=PXWeWFMxS4ADneAuf6HuV%2B_zjoJDhwk7Y1zp1aU87zDCQ>