summaryrefslogtreecommitdiffstats
path: root/sys/fs/tmpfs/tmpfs_subr.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2014-07-14 08:55:02 +0000
committerkib <kib@FreeBSD.org>2014-07-14 08:55:02 +0000
commit7dd9ab980a47b3ba8e37c7e7458baa629759e34b (patch)
treef4118f95112031759cad24c4390fcef5fbf46b74 /sys/fs/tmpfs/tmpfs_subr.c
parent8542c8b735cda87e94daa65cef2491ac0e1bfb92 (diff)
downloadFreeBSD-src-7dd9ab980a47b3ba8e37c7e7458baa629759e34b.zip
FreeBSD-src-7dd9ab980a47b3ba8e37c7e7458baa629759e34b.tar.gz
Add some assertions for the code handling vm_object for tmpfs vnode.
In particular, vnode must be exclusively locked when the tmpfs vnode and object are divorced. When the vnode is opened, the object must be still alive, since only live vnode can be opened, and the tmpfs node owns a reference on the object. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
Diffstat (limited to 'sys/fs/tmpfs/tmpfs_subr.c')
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index 66ef3e3..4c179ab 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -428,6 +428,7 @@ void
tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj)
{
+ ASSERT_VOP_ELOCKED(vp, "tmpfs_destroy_vobject");
if (vp->v_type != VREG || obj == NULL)
return;
OpenPOWER on IntegriCloud