MFC: Lock the vnode interlock while reading v_usecount to update
si_usecount in a cdev in devfs_reclaim().
This commit is contained in:
parent
2eab57b4d5
commit
35e8ffa483
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user