Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Oct 2022 17:24:21 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 5bd45b2ba3f2 - main - swap_pager_find_least(): assert that the function is called on the right object type
Message-ID:  <202210191724.29JHOLXs073850@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=5bd45b2ba3f23e5bc04b64c80c7446382bce0351

commit 5bd45b2ba3f23e5bc04b64c80c7446382bce0351
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-10-18 08:21:14 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-10-19 17:24:07 +0000

    swap_pager_find_least(): assert that the function is called on the right object type
    
    Reviewed by:    markj
    Tested by:      pho
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D37024
---
 sys/vm/swap_pager.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 4db33d4ca88e..bcf9a24d400d 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2259,6 +2259,7 @@ swap_pager_find_least(vm_object_t object, vm_pindex_t pindex)
 	int i;
 
 	VM_OBJECT_ASSERT_LOCKED(object);
+	MPASS((object->flags & OBJ_SWAP) != 0);
 
 	if (pctrie_is_empty(&object->un_pager.swp.swp_blks))
 		return (object->size);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202210191724.29JHOLXs073850>