Date: Sun, 28 Apr 2013 19:19:26 +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: r250028 - head/sys/vm Message-ID: <201304281919.r3SJJQI9031998@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Apr 28 19:19:26 2013 New Revision: 250028 URL: http://svnweb.freebsd.org/changeset/base/250028 Log: Assert that the object type for the vnode' non-NULL v_object, passed to vnode_pager_setsize(), is either OBJT_VNODE, or, if vnode was already reclaimed, OBJT_DEAD. Note that the later is only possible due to some filesystems, in particular, nfsiods from nfs clients, call vnode_pager_setsize() with unlocked vnode. More, if the object is terminated, do not perform the resizing operation. Reviewed by: alc Tested by: pho, bf MFC after: 1 week Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Apr 28 19:12:09 2013 (r250027) +++ head/sys/vm/vnode_pager.c Sun Apr 28 19:19:26 2013 (r250028) @@ -380,6 +380,12 @@ vnode_pager_setsize(vp, nsize) return; /* ASSERT_VOP_ELOCKED(vp, "vnode_pager_setsize and not locked vnode"); */ VM_OBJECT_WLOCK(object); + if (object->type == OBJT_DEAD) { + VM_OBJECT_WUNLOCK(object); + return; + } + KASSERT(object->type == OBJT_VNODE, + ("not vnode-backed object %p", object)); if (nsize == object->un_pager.vnp.vnp_size) { /* * Hasn't changed size
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304281919.r3SJJQI9031998>