From owner-freebsd-fs@FreeBSD.ORG Sat Feb 17 21:04:43 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D709A16A406; Sat, 17 Feb 2007 21:04:43 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.freebsd.org (Postfix) with ESMTP id 73DF513C4A7; Sat, 17 Feb 2007 21:04:43 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 391B9456B1; Sat, 17 Feb 2007 22:04:42 +0100 (CET) Received: from localhost (154.81.datacomsa.pl [195.34.81.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 2EE2545681; Sat, 17 Feb 2007 22:04:36 +0100 (CET) Date: Sat, 17 Feb 2007 22:03:22 +0100 From: Pawel Jakub Dawidek To: Eric Anderson Message-ID: <20070217210322.GB64936@garage.freebsd.pl> References: <45D69918.3000008@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="61jdw2sOBCFtR2d/" Content-Disposition: inline In-Reply-To: <45D69918.3000008@freebsd.org> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng/devel-r804 (FreeBSD) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: "freebsd-fs@freebsd.org" Subject: Re: question about vfs_lookup X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2007 21:04:43 -0000 --61jdw2sOBCFtR2d/ Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 16, 2007 at 11:56:40PM -0600, Eric Anderson wrote: > I'm just curious about how this block (starting at line 712) could possib= ly ever get executed, since right before it there is a condition that would= cause a panic. >=20 > Can anyone explain this please? You read KASSERT(9) in a wrong way. The condition used in assertion says "don't panic if the condition is true". Here we panic when flag ISLASTCN is not set and *ndp->ni_next is not equal to '/'. > In sys/kern/vfs_lookup.c: > 710 KASSERT((cnp->cn_flags & ISLASTCN) || *ndp->ni_next =3D=3D '/= ', > 711 ("lookup: invalid path state.")); > 712 if (*ndp->ni_next =3D=3D '/') { > 713 cnp->cn_nameptr =3D ndp->ni_next; > 714 while (*cnp->cn_nameptr =3D=3D '/') { > 715 cnp->cn_nameptr++; > 716 ndp->ni_pathlen--; > 717 } > 718 if (ndp->ni_dvp !=3D dp) > 719 vput(ndp->ni_dvp); > 720 else > 721 vrele(ndp->ni_dvp); > 722 VFS_UNLOCK_GIANT(dvfslocked); > 723 dvfslocked =3D vfslocked; /* dp becomes dvp in dirloo= p */ > 724 vfslocked =3D 0; > 725 goto dirloop; > 726 } --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --61jdw2sOBCFtR2d/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFF122aForvXbEpPzQRAuPXAJ0TObEF1Cb23L+EbDSzYIuVZTriFgCfWZMj Ks8fpKFxdmwyNrj+g+iYDTE= =FHlZ -----END PGP SIGNATURE----- --61jdw2sOBCFtR2d/--