Re: vnode lock assertion violation in devfs_fixup()

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Wed, 22 Dec 2004 19:05:31 +0100
In message <200412190732.iBJ7WSHC066183_at_gw.catspoiler.org>, Don Lewis writes:

>The vput() call is actually in devfs_fixup():
>
>        mp->mnt_vnodecovered = vp;
>        vp->v_mountedhere = mp;
>        mtx_lock(&mountlist_mtx);
>        TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list);
>        mtx_unlock(&mountlist_mtx);
>        VOP_UNLOCK(vp, 0, td);
>        vfs_unbusy(mp, td);
>        VREF(vp);
>--->    vput(vp);
>        vput(dvp);  
>
>vput() is supposed to be called with the vnode lock held and it releases
>the lock, which won't work too well because the vnode was just unlocked
>3 lines earlier.  vput() also decrements the vnode reference count, but
>why are we incrementing the reference count on the line above?   I
>suspect that the VREF()/vput() sequence should just go away.

That sounds like the most likely fix :-)

I just tried to faithfully emulate the previous code in all respects
and never got around to fix this up.

If you can confirm that just removing VREF+vput works, then by all
means commit it.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
Received on Wed Dec 22 2004 - 17:05:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:25 UTC