From owner-svn-src-head@freebsd.org Wed Jan 1 02:41:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD0F01E3A3D; Wed, 1 Jan 2020 02:41:57 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-vk1-f169.google.com (mail-vk1-f169.google.com [209.85.221.169]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47nb6F4yRPz3yKW; Wed, 1 Jan 2020 02:41:57 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-vk1-f169.google.com with SMTP id d17so9283428vke.5; Tue, 31 Dec 2019 18:41:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cJefTFrXNn8z6GgD+WAgy/8po+JjEM5SHqraUNEOU/M=; b=VXUA0pJCfwHD/odnv7Ehp7VN/ajM2xFwoKF2Pkgc+uJhpX1HVUlu+8jdgGxo1HDi0K Kgbnh7LVSYfR8UlbzwoBnJa2K2zZUQpbRq54j9U96Bc5PZwskwW4NRT4zT6CxOZ/13hf LuxeBZY3ylh/MESV3iid1506cWVYL3IkYr7veGnIg97OBEvkoAK9I6h5tPkHuHZi8z1Q qNTZSTjpIf3Y3YqeiIrroKQdthpCJDmVV9QfR2ZA5EEmStMskLzkQiibM3by9dOrGgvo pCbiuccaQgn3UCWPy1WMEDvm/7bjVbatNzLiFy1XrAKEjTXo9gTQcE8ONCsimVtGozMb +6dw== X-Gm-Message-State: APjAAAXfeM7+dGaiaSSl/v66dM8ZKivXaxxLBynIEsGK9wvSVy1tD6mW LddrMw+4Nb1YBJehOR1Gis80k954tJG+jhcIIlk8+w== X-Google-Smtp-Source: APXvYqxFIPJg11PdqGLDffT0ffvS/rZZAB5bc7mF1jfXIyu+U7dh/t7bqXXuVluOF+nWYNlQdEGXIX5f+7LCUojNck8= X-Received: by 2002:a1f:cec2:: with SMTP id e185mr43469059vkg.22.1577846516162; Tue, 31 Dec 2019 18:41:56 -0800 (PST) MIME-Version: 1.0 References: <201912311858.xBVIwUSh048909@repo.freebsd.org> In-Reply-To: From: Alexander Motin Date: Tue, 31 Dec 2019 21:41:46 -0500 Message-ID: Subject: Re: svn commit: r356240 - head/sys/netinet To: koobs@freebsd.org Cc: src-committers , svn-src-all , svn-src-head@freebsd.org X-Rspamd-Queue-Id: 47nb6F4yRPz3yKW X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jan 2020 02:41:57 -0000 Hi, We hit it on 11.3. So I am going to MFC it. On Tue, Dec 31, 2019, 9:37 PM Kubilay Kocak 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 ? >