From owner-svn-src-head@freebsd.org Fri Dec 30 17:37:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF676C97A1D; Fri, 30 Dec 2016 17:37:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F3A8130B; Fri, 30 Dec 2016 17:37:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUHb6L7005884; Fri, 30 Dec 2016 17:37:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHb62e005883; Fri, 30 Dec 2016 17:37:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612301737.uBUHb62e005883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 30 Dec 2016 17:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310834 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 17:37:07 -0000 Author: kib Date: Fri Dec 30 17:37:06 2016 New Revision: 310834 URL: https://svnweb.freebsd.org/changeset/base/310834 Log: Assert that the pages found on the object queue by vm_page_next() and vm_page_prev() have correct ownership. In collaboration with: alc Sponsored by: The FreeBSD Foundation (kib) MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Dec 30 17:36:08 2016 (r310833) +++ head/sys/vm/vm_page.c Fri Dec 30 17:37:06 2016 (r310834) @@ -1328,9 +1328,11 @@ vm_page_next(vm_page_t m) vm_page_t next; VM_OBJECT_ASSERT_LOCKED(m->object); - if ((next = TAILQ_NEXT(m, listq)) != NULL && - next->pindex != m->pindex + 1) - next = NULL; + if ((next = TAILQ_NEXT(m, listq)) != NULL) { + MPASS(next->object == m->object); + if (next->pindex != m->pindex + 1) + next = NULL; + } return (next); } @@ -1346,9 +1348,11 @@ vm_page_prev(vm_page_t m) vm_page_t prev; VM_OBJECT_ASSERT_LOCKED(m->object); - if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL && - prev->pindex != m->pindex - 1) - prev = NULL; + if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL) { + MPASS(prev->object == m->object); + if (prev->pindex != m->pindex - 1) + prev = NULL; + } return (prev); }