git: 02e85d1c8a41 - main - swap_pager: fix assert in seek_data

From: Doug Moore <dougm_at_FreeBSD.org>
Date: Thu, 24 Oct 2024 23:04:36 UTC
The branch main has been updated by dougm:

URL: https://cgit.FreeBSD.org/src/commit/?id=02e85d1c8a41cbf6de1899318b25626e62144363

commit 02e85d1c8a41cbf6de1899318b25626e62144363
Author:     Doug Moore <dougm@FreeBSD.org>
AuthorDate: 2024-10-24 23:00:47 +0000
Commit:     Doug Moore <dougm@FreeBSD.org>
CommitDate: 2024-10-24 23:04:19 +0000

    swap_pager: fix assert in seek_data
    
    An assertion that an object was write-locked should be instead an
    assertion that the object is read locked.
    
    Reported by:    Jenkins
    Fixes:   db08b0b04deced tmpfs_vnops: move swap work to swap_pager
    Differential Revision:  https://reviews.freebsd.org/D47278
---
 sys/vm/swap_pager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 90d44d3e7402..3d21d42da6c3 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2487,7 +2487,7 @@ swap_pager_seek_data(vm_object_t object, vm_pindex_t pindex)
 	vm_page_t m;
 	vm_pindex_t swap_index;
 
-	VM_OBJECT_ASSERT_WLOCKED(object);
+	VM_OBJECT_ASSERT_RLOCKED(object);
 	vm_page_iter_init(&pages, object);
 	m = vm_page_iter_lookup_ge(&pages, pindex);
 	if (m != NULL) {