MFC: Lock the vnode interlock while reading v_usecount to update

si_usecount in a cdev in devfs_reclaim().
This commit is contained in:
jhb 2008-01-12 00:17:50 +00:00
parent 2eab57b4d5
commit 35e8ffa483

View File

@ -987,17 +987,20 @@ devfs_reclaim(struct vop_reclaim_args *ap)
vnode_destroy_vobject(vp);
VI_LOCK(vp);
dev_lock();
dev = vp->v_rdev;
vp->v_rdev = NULL;
if (dev == NULL) {
dev_unlock();
VI_UNLOCK(vp);
return (0);
}
dev->si_usecount -= vp->v_usecount;
dev_unlock();
VI_UNLOCK(vp);
dev_rel(dev);
return (0);
}