mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-25 18:12:57 +01:00
tmpfs: recalculate OBJ_TMPFS_VREF on reinstantiating node' vnode
Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45119
This commit is contained in:
parent
663838451e
commit
58d7ac11e7
@ -1094,15 +1094,19 @@ loop:
|
||||
KASSERT((object->flags & OBJ_TMPFS_VREF) == 0,
|
||||
("%s: object %p with OBJ_TMPFS_VREF but without vnode",
|
||||
__func__, object));
|
||||
KASSERT(object->un_pager.swp.writemappings == 0,
|
||||
("%s: object %p has writemappings",
|
||||
__func__, object));
|
||||
VI_LOCK(vp);
|
||||
KASSERT(vp->v_object == NULL, ("Not NULL v_object in tmpfs"));
|
||||
vp->v_object = object;
|
||||
vn_irflag_set_locked(vp, (tm->tm_pgread ? VIRF_PGREAD : 0) |
|
||||
VIRF_TEXT_REF);
|
||||
VI_UNLOCK(vp);
|
||||
VNASSERT((object->flags & OBJ_TMPFS_VREF) == 0, vp,
|
||||
("leaked OBJ_TMPFS_VREF"));
|
||||
if (object->un_pager.swp.writemappings > 0) {
|
||||
vrefact(vp);
|
||||
vlazy(vp);
|
||||
vm_object_set_flag(object, OBJ_TMPFS_VREF);
|
||||
}
|
||||
VM_OBJECT_WUNLOCK(object);
|
||||
break;
|
||||
case VDIR:
|
||||
|
Loading…
Reference in New Issue
Block a user