Date: Mon, 14 Jul 2014 08:55:02 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268609 - head/sys/fs/tmpfs Message-ID: <201407140855.s6E8t23g037792@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Jul 14 08:55:02 2014 New Revision: 268609 URL: http://svnweb.freebsd.org/changeset/base/268609 Log: 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 Modified: head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 14 08:45:29 2014 (r268608) +++ head/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 14 08:55:02 2014 (r268609) @@ -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; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 14 08:45:29 2014 (r268608) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Mon Jul 14 08:55:02 2014 (r268609) @@ -258,6 +258,8 @@ tmpfs_open(struct vop_open_args *v) else { error = 0; /* For regular files, the call below is nop. */ + KASSERT(vp->v_type != VREG || (node->tn_reg.tn_aobj->flags & + OBJ_DEAD) == 0, ("dead object")); vnode_create_vobject(vp, node->tn_size, v->a_td); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407140855.s6E8t23g037792>