Date: Thu, 2 Jun 2016 16:58:48 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301210 - head/sys/vm Message-ID: <201606021658.u52GwmaG071545@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Thu Jun 2 16:58:47 2016 New Revision: 301210 URL: https://svnweb.freebsd.org/changeset/base/301210 Log: Don't preserve the page's object linkage in vm_page_insert_after(). Per the KASSERT at the beginning of the function, we expect that the page does not belong to any object, so its object and pindex fields are meaningless. Reset them in the rare case that vm_radix_insert() fails. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6669 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Jun 2 16:40:09 2016 (r301209) +++ head/sys/vm/vm_page.c Thu Jun 2 16:58:47 2016 (r301210) @@ -1112,8 +1112,6 @@ static int vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, vm_page_t mpred) { - vm_pindex_t sidx; - vm_object_t sobj; vm_page_t msucc; VM_OBJECT_ASSERT_WLOCKED(object); @@ -1134,8 +1132,6 @@ vm_page_insert_after(vm_page_t m, vm_obj /* * Record the object/offset pair in this page */ - sobj = m->object; - sidx = m->pindex; m->object = object; m->pindex = pindex; @@ -1143,8 +1139,8 @@ vm_page_insert_after(vm_page_t m, vm_obj * Now link into the object's ordered list of backed pages. */ if (vm_radix_insert(&object->rtree, m)) { - m->object = sobj; - m->pindex = sidx; + m->object = NULL; + m->pindex = 0; return (1); } vm_page_insert_radixdone(m, object, mpred);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606021658.u52GwmaG071545>