Lock the vnode interlock while reading v_usecount to update si_usecount

in a cdev in devfs_reclaim().

MFC after:	3 days
Reviewed by:	jeff (a while ago)
This commit is contained in:
John Baldwin 2008-01-08 04:45:24 +00:00
parent 357911ce77
commit 314464f422

View file

@ -992,17 +992,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);
}