From owner-freebsd-stable@FreeBSD.ORG Thu Mar 27 09:56:36 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E39A106566B; Thu, 27 Mar 2008 09:56:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay03.kiev.sovam.com (relay03.kiev.sovam.com [62.64.120.201]) by mx1.freebsd.org (Postfix) with ESMTP id C04DC8FC26; Thu, 27 Mar 2008 09:56:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay03.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JeoqV-000Cp3-RG; Thu, 27 Mar 2008 11:56:34 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m2R9uJSW078066 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 Mar 2008 11:56:19 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m2R9u7gd065968; Thu, 27 Mar 2008 11:56:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m2R9u7j5065967; Thu, 27 Mar 2008 11:56:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 27 Mar 2008 11:56:07 +0200 From: Kostik Belousov To: Peter Much Message-ID: <20080327095607.GS7965@deviant.kiev.zoral.com.ua> References: <200803261700.12851.jhb@freebsd.org> <20080326234513.GA30601@gate.oper.dinoex.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ShzQXCswyqjgWi6k" Content-Disposition: inline In-Reply-To: <20080326234513.GA30601@gate.oper.dinoex.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua X-Scanner-Signature: dc9851233e967de4527dd65bbc92362e X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2502 [Mar 26 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release Cc: freebsd-stable@freebsd.org, John Baldwin Subject: Re: "s/stable/broken/g" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2008 09:56:36 -0000 --ShzQXCswyqjgWi6k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 27, 2008 at 12:45:13AM +0100, Peter Much wrote: > On Wed, Mar 26, 2008 at 05:00:12PM -0400, John Baldwin wrote: >=20 > ! Try this patch for de(4). >=20 > Thanks fpr the reply. I'll try this patch at next reboot. >=20 > ! You need to supply the panic details for the devfs=20 > ! one (I've used devfs rules w/o issue on lots of machines=20 > ! via /etc/devfs.conf). >=20 > I have found, eh, not the solution but the problem. ;) > This one: kern/89784 describes the same symptom and nearly > the same backtrace. And it is still open, so this, well, just > seems to exist. And, things being this way, I don't think=20 > there is need for me to do any more about it for now, as > this does not really hurt and workaround is easy. Try the rev. 1.24 of the devfs_rule.c. In fact, it is fixed by somewhat bigger patch that I inlined below. It is already in CURRENT and RELENG_7. Index: fs/devfs/devfs_rule.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/arch/ncvs/src/sys/fs/devfs/devfs_rule.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- fs/devfs/devfs_rule.c 6 Nov 2006 13:41:56 -0000 1.23 +++ fs/devfs/devfs_rule.c 20 Mar 2008 16:08:42 -0000 1.24 @@ -527,6 +527,7 @@ { struct devfs_rule *dr =3D &dk->dk_rule; struct cdev *dev; + struct cdevsw *dsw; =20 dev =3D devfs_rule_getdev(de); /* @@ -540,13 +541,19 @@ * They're actually testing to see whether the condition does * *not* match, since the default is to assume the rule should * be run (such as if there are no conditions). - * - * XXX: lacks threadref on dev */ - if (dr->dr_icond & DRC_DSWFLAGS) - if (dev =3D=3D NULL || - (dev->si_devsw->d_flags & dr->dr_dswflags) =3D=3D 0) + if (dr->dr_icond & DRC_DSWFLAGS) { + if (dev =3D=3D NULL) + return (0); + dsw =3D dev_refthread(dev); + if (dsw =3D=3D NULL) + return (0); + if ((dsw->d_flags & dr->dr_dswflags) =3D=3D 0) { + dev_relthread(dev); return (0); + } + dev_relthread(dev); + } if (dr->dr_icond & DRC_PATHPTRN) if (!devfs_rule_matchpath(dk, de)) return (0); Index: vm/vm_mmap.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/arch/ncvs/src/sys/vm/vm_mmap.c,v retrieving revision 1.217 retrieving revision 1.218 diff -u -r1.217 -r1.218 --- vm/vm_mmap.c 16 Mar 2008 10:58:09 -0000 1.217 +++ vm/vm_mmap.c 20 Mar 2008 16:08:42 -0000 1.218 @@ -1160,6 +1160,7 @@ void *handle; vm_object_t obj; struct mount *mp; + struct cdevsw *dsw; int error, flags, type; int vfslocked; =20 @@ -1190,13 +1191,19 @@ type =3D OBJT_DEVICE; handle =3D vp->v_rdev; =20 - /* XXX: lack thredref on device */ - if(vp->v_rdev->si_devsw->d_flags & D_MMAP_ANON) { + dsw =3D dev_refthread(handle); + if (dsw =3D=3D NULL) { + error =3D ENXIO; + goto done; + } + if (dsw->d_flags & D_MMAP_ANON) { + dev_relthread(handle); *maxprotp =3D VM_PROT_ALL; *flagsp |=3D MAP_ANON; error =3D 0; goto done; } + dev_relthread(handle); /* * cdevs does not provide private mappings of any kind. */ @@ -1273,16 +1280,21 @@ struct cdev *cdev, vm_ooffset_t foff, vm_object_t *objp) { vm_object_t obj; + struct cdevsw *dsw; int flags; =20 flags =3D *flagsp; =20 - /* XXX: lack thredref on device */ - if (cdev->si_devsw->d_flags & D_MMAP_ANON) { + dsw =3D dev_refthread(cdev); + if (dsw =3D=3D NULL) + return (ENXIO); + if (dsw->d_flags & D_MMAP_ANON) { + dev_relthread(cdev); *maxprotp =3D VM_PROT_ALL; *flagsp |=3D MAP_ANON; return (0); } + dev_relthread(cdev); /* * cdevs does not provide private mappings of any kind. */ --ShzQXCswyqjgWi6k Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkfrbzcACgkQC3+MBN1Mb4iq8wCghaYXvHnBqa27cnrSttG6evCk sDMAoI6kWlN/OipcOCAoGeoucc5/uB0c =9jcR -----END PGP SIGNATURE----- --ShzQXCswyqjgWi6k--