Skip to content

Commit ab135e1

Browse files
committed
tmpfs_destroy_vobject(): clear v_object under the object lock
(cherry picked from commit 4681194)
1 parent f0d6377 commit ab135e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sys/fs/tmpfs/tmpfs_subr.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ tmpfs_pager_writecount_recalc(vm_object_t object, vm_offset_t old,
116116
/*
117117
* Forced unmount?
118118
*/
119-
if (vp == NULL) {
119+
if (vp == NULL || vp->v_object == NULL) {
120120
KASSERT((object->flags & OBJ_TMPFS_VREF) == 0,
121121
("object %p with OBJ_TMPFS_VREF but without vnode",
122122
object));
@@ -916,6 +916,8 @@ tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj)
916916

917917
VM_OBJECT_WLOCK(obj);
918918
VI_LOCK(vp);
919+
vp->v_object = NULL;
920+
919921
/*
920922
* May be going through forced unmount.
921923
*/

0 commit comments

Comments
 (0)