Date: Tue, 30 Aug 2005 15:47:04 -0700 From: Alfred Perlstein <alfred@freebsd.org> To: Alexander Kabaev <kan@FreeBSD.org> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern vfs_lookup.c Message-ID: <20050830224704.GI77060@elvis.mu.org> In-Reply-To: <200508301612.j7UGC3CM085774@repoman.freebsd.org> References: <200508301612.j7UGC3CM085774@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Ok, maybe I'm missing something, but... while (dp->v_type == VDIR && (mp = dp->v_mountedhere) && (cnp->cn_flags & NOCROSSMOUNT) == 0) { KASSERT(dp != ndp->ni_dvp, ("XXX")); if (vfs_busy(mp, 0, 0, td)) continue; here ->>> vput(dp); tvfslocked = VFS_LOCK_GIANT(mp); VFS_UNLOCK_GIANT(vfslocked); vfslocked = tvfslocked; VOP_UNLOCK(ndp->ni_dvp, 0, td); error = 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 = 1; goto bad2; } ndp->ni_vp = dp = tdp; } 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... 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. Is this OK? -Alfred * Alexander Kabaev <kan@FreeBSD.org> [050830 09:12] wrote: > kan 2005-08-30 16:12:03 UTC > > FreeBSD src repository > > Modified files: (Branch: RELENG_6) > sys/kern vfs_lookup.c > 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. > > Approved by: re (scottl) > > Revision Changes Path > 1.80.2.1 +2 -0 src/sys/kern/vfs_lookup.c -- - Alfred Perlstein
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050830224704.GI77060>