From owner-cvs-all@FreeBSD.ORG Wed Sep 21 19:23:46 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1CFFD16A41F; Wed, 21 Sep 2005 19:23:45 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 54B8543D45; Wed, 21 Sep 2005 19:23:45 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j8LJNg7I049757; Wed, 21 Sep 2005 22:23:42 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 05228-04; Wed, 21 Sep 2005 22:23:40 +0300 (EEST) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j8LJNMMH049745 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Sep 2005 22:23:22 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.3/8.13.3) id j8LJNdsu034907; Wed, 21 Sep 2005 22:23:39 +0300 (EEST) (envelope-from ru) Date: Wed, 21 Sep 2005 22:23:38 +0300 From: Ruslan Ermilov To: John Baldwin Message-ID: <20050921192338.GB24516@ip.net.ua> References: <200509190310.j8J3ALgt095979@repoman.freebsd.org> <20050920223315.V34322@fledge.watson.org> <20050921154153.GB22964@ip.net.ua> <200509211455.59154.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MW5yreqqjyrRcusr" Content-Disposition: inline In-Reply-To: <200509211455.59154.jhb@FreeBSD.org> User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at ip.net.ua Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Robert Watson , cvs-all@FreeBSD.org, "M. Warner Losh" Subject: Re: cvs commit: src/sys/dev/an if_an.c src/sys/dev/arl if_arl_isa.c src/sys/dev/awi if_awi_pccard.c src/sys/dev/cm if_cm_isa.c src/sys/dev/cnw if_cnw.c src/sys/dev/cp if_cp.c src/sys/dev/cs if_cs.c src/sys/dev/ed if_ed.c src/sys/dev/em if_em.c ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2005 19:23:46 -0000 --MW5yreqqjyrRcusr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 21, 2005 at 02:55:57PM -0400, John Baldwin wrote: [...] > > 3. Fix all drivers to check IFF_DRV_RUNNING in foo_start() and exit > > if it's unset. This should fix another half of shutdown panics, > > e.g. the one demonstrated by glebius@ in recent if_em.c commit. > > > > 4. Remove IFF_DRV_RUNNING check from ether_output(). > > > > 5. Fix all drivers to set some flag in foo_detach() and foo_shutdown() > > and refuse to work in foo_ioctl() if it's set. This should fix > > panics when BPF listener is attached while interface goes away or > > module is unloaded. > > > > Relevant PRs: kern/85005, kern/62889. > > > > Attached is a demo patch for rl(4) that does all of the above > > except #4. >=20 > I think you can leave #4 in if the race doesn't hurt anything. 3) alread= y=20 > handles the condition you are worried about. I'd rather 5) be simpler in= =20 > that it only check in the flags case to not force the driver lock to be= =20 > acquired for all the ioctls that the driver doesn't actually handle. =20 > Actually, I think I'd really prefer that we think about how to fix the BP= F=20 > issue in BPF itself if possible. It may be that we don't need to set the= =20 > flags (i.e. skip the actual ioctl) if the interface is in the process of= =20 > detaching and we can make that change centrally without having to scatter= =20 > gone flags in all the drivers. >=20 BPF is just one (known) problem, but we'd like to fix it once and for all, "ifconfig during detach" Warner mentioned is just another one. I'd very much like some generic solution that doesn't involve adding this check to every foo_ioctl(), but I have no idea at the moment. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --MW5yreqqjyrRcusr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFDMbM6qRfpzJluFF4RAnoXAJ9WgHEJUT2FKfREcy1Cgo3Qx7JQzwCfe26s 8RfkLXow/GfLIA5gNBtexHY= =mmEk -----END PGP SIGNATURE----- --MW5yreqqjyrRcusr--