diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2013-05-02 18:44:31 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2013-05-02 18:44:31 +0000 |
commit | 158cc900bb8561383f99680146eed49625416817 (patch) | |
tree | 9d3aeb6624a9893d4aa6ff0ec6a26d367985da7a /sys/fs/tmpfs/tmpfs_vnops.c | |
parent | bdefcb6959410748a53a58dd8a15d78e6e0d2f42 (diff) | |
download | src-158cc900bb8561383f99680146eed49625416817.tar.gz src-158cc900bb8561383f99680146eed49625416817.zip |
For the new regular tmpfs vnode, v_object is initialized before
insmntque() is called. The standard insmntque destructor resets the
vop vector to deadfs one, and calls vgone() on the vnode. As result,
v_object is kept unchanged, which triggers an assertion in the reclaim
code, on instmntque() failure. Also, in this case, OBJ_TMPFS flag on
the backed vm object is not cleared.
Provide the tmpfs insmntque() destructor which properly clears
OBJ_TMPFS flag and resets v_object.
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
Notes
Notes:
svn path=/head/; revision=250189
Diffstat (limited to 'sys/fs/tmpfs/tmpfs_vnops.c')
-rw-r--r-- | sys/fs/tmpfs/tmpfs_vnops.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 029aefbdb5b3..480818125245 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1468,23 +1468,12 @@ tmpfs_reclaim(struct vop_reclaim_args *v) struct tmpfs_mount *tmp; struct tmpfs_node *node; - vm_object_t obj; node = VP_TO_TMPFS_NODE(vp); tmp = VFS_TO_TMPFS(vp->v_mount); - if (node->tn_type == VREG) { - obj = node->tn_reg.tn_aobj; - if (obj != NULL) { - /* Instead of vnode_destroy_vobject() */ - VM_OBJECT_WLOCK(obj); - VI_LOCK(vp); - vm_object_clear_flag(obj, OBJ_TMPFS); - obj->un_pager.swp.swp_tmpfs = NULL; - VI_UNLOCK(vp); - VM_OBJECT_WUNLOCK(obj); - } - } + if (vp->v_type == VREG) + tmpfs_destroy_vobject(vp, node->tn_reg.tn_aobj); vp->v_object = NULL; cache_purge(vp); |