Date: Tue, 30 Aug 2005 21:16:44 -0400 From: Alexander Kabaev <kabaev@gmail.com> To: Alfred Perlstein <alfred@freebsd.org> Cc: Alexander Kabaev <kan@FreeBSD.org>, cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern vfs_lookup.c 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>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <alfred@freebsd.org> 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 <kan@FreeBSD.org> [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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050830211644.339c86db>