mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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:
parent
357911ce77
commit
314464f422
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue