diff options
author | kib <kib@FreeBSD.org> | 2013-04-28 19:19:26 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-04-28 19:19:26 +0000 |
commit | dae393576885009863cdf2f416eba41391fa7712 (patch) | |
tree | e988fafd506fcb0a5d479fd7f688c47b04551ef3 /sys | |
parent | ebecd57ee2dd46812376994b4fb9cf9c81af71c5 (diff) | |
download | FreeBSD-src-dae393576885009863cdf2f416eba41391fa7712.zip FreeBSD-src-dae393576885009863cdf2f416eba41391fa7712.tar.gz |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/vnode_pager.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 296511e..fa92768 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -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 |