From owner-cvs-all@FreeBSD.ORG Wed Aug 31 01:16:56 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 4513416A420 for ; Wed, 31 Aug 2005 01:16:56 +0000 (GMT) (envelope-from kabaev@gmail.com) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 575F343D55 for ; Wed, 31 Aug 2005 01:16:52 +0000 (GMT) (envelope-from kabaev@gmail.com) Received: by rproxy.gmail.com with SMTP id r35so16787rna for ; Tue, 30 Aug 2005 18:16:49 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; b=X1duS6zif332jEaofUAWfJ4SQwX0gswamQAnzS5oeDNIYXyzwvD6KSszNUXo0WSKIDdzOmIvXIVCaQnUqUn040ff+OxeZGEGcpFV2a4+YfJFkAaCNxShyVaAly8jAXy/oI/Lddyc2+cupV12+TV3TKCq2zZ8lxnMy0kQ/k/vVaA= Received: by 10.38.161.7 with SMTP id j7mr16105rne; Tue, 30 Aug 2005 18:16:49 -0700 (PDT) Received: from kan.dnsalias.net ( [24.63.93.195]) by mx.gmail.com with ESMTP id g2sm128071rne.2005.08.30.18.16.49; Tue, 30 Aug 2005 18:16:49 -0700 (PDT) Date: Tue, 30 Aug 2005 21:16:44 -0400 From: Alexander Kabaev To: Alfred Perlstein Message-ID: <20050830211644.339c86db@kan.dnsalias.net> In-Reply-To: <20050830224704.GI77060@elvis.mu.org> References: <200508301612.j7UGC3CM085774@repoman.freebsd.org> <20050830224704.GI77060@elvis.mu.org> X-Mailer: Sylpheed-Claws 1.9.13 (GTK+ 2.6.9; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Signature_Tue__30_Aug_2005_21_16_44_-0400_jKUEwb3gwzt1VkZm; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: Alexander Kabaev , cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern vfs_lookup.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, 31 Aug 2005 01:16:56 -0000 --Signature_Tue__30_Aug_2005_21_16_44_-0400_jKUEwb3gwzt1VkZm Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 30 Aug 2005 15:47:04 -0700 Alfred Perlstein wrote: > Ok, maybe I'm missing something, but... >=20 > while (dp->v_type =3D=3D VDIR && (mp =3D dp->v_mountedhere) && > (cnp->cn_flags & NOCROSSMOUNT) =3D=3D 0) { > KASSERT(dp !=3D ndp->ni_dvp, ("XXX")); > if (vfs_busy(mp, 0, 0, td)) > continue; > here ->>> vput(dp); > tvfslocked =3D VFS_LOCK_GIANT(mp); > VFS_UNLOCK_GIANT(vfslocked); > vfslocked =3D tvfslocked; > VOP_UNLOCK(ndp->ni_dvp, 0, td); > error =3D VFS_ROOT(mp, cnp->cn_lkflags, &tdp, td); > VOP_LOCK(ndp->ni_dvp, cnp->cn_lkflags | LK_RETRY, td); > vfs_unbusy(mp, td); > if (error) { > dpunlocked =3D 1; > goto bad2; > } > ndp->ni_vp =3D dp =3D tdp; > } >=20 > Isn't dp already unlocked here? vput should be unlocking the vnode > and we have the above KASSERT showing that they should be the same > vnode... dp !=3D ndp->ni_dvp at that point. If we have amd serving /home, ndp->ni_dvp is '/' directory dp is /home directory =20 Having / locked while waiting for VFS_ROOT on amd filesystem serves no purpose. > Also, I think lockparent doesn't need to be respected because > we're trading parent vnodes. Basically, we're hitting a vnode > that has another vnode stacked on it (root vnode), and switching to > it. we're not actually decending. >=20 > Is this OK? >=20 > -Alfred >=20 >=20 >=20 > * Alexander Kabaev [050830 09:12] wrote: > > kan 2005-08-30 16:12:03 UTC > >=20 > > FreeBSD src repository > >=20 > > Modified files: (Branch: RELENG_6) > > sys/kern vfs_lookup.c=20 > > Log: > > MFC r1.81: > > Do not keep parent directory locked while calling VFS_ROOT to > > traverse mount points in lookup(). The lock can be dropped safely > > around VFS_ROOT because LOCKPARENT semantics with child and parent > > vnodes coming from different FSes does not really have any > > meaningful use and we do not really care about parent state after > > we relock it. This prevents easily triggered deadlock on systems > > using automounter daemon. > > =20 > > Approved by: re (scottl) > > =20 > > Revision Changes Path > > 1.80.2.1 +2 -0 src/sys/kern/vfs_lookup.c >=20 > --=20 > - Alfred Perlstein --=20 Alexander Kabaev --Signature_Tue__30_Aug_2005_21_16_44_-0400_jKUEwb3gwzt1VkZm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDFQT/Q6z1jMm+XZYRAvsAAJ9yxJbuZrb5j+rrzrD1L4yhjPp5fQCgySmJ K7ppNeA7oXphk3xywnxaNDQ= =GE0Q -----END PGP SIGNATURE----- --Signature_Tue__30_Aug_2005_21_16_44_-0400_jKUEwb3gwzt1VkZm--