git: ff481f220232 - stable/13 - Fix shared_shadow_inval_test when superpages are disabled

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 23 Aug 2022 20:46:58 UTC
The branch stable/13 has been updated by markj:

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

commit ff481f220232db52b8a85c298d04a349f6980c3e
Author:     Eric van Gyzen <vangyzen@FreeBSD.org>
AuthorDate: 2022-08-19 20:05:19 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-08-23 20:15:49 +0000

    Fix shared_shadow_inval_test when superpages are disabled
    
    In that case, there is only one page size.
    
    Reviewed by:    kib
    Sponsored by:   Dell EMC Isilon
    
    (cherry picked from commit 3d268c19efb8b47dde1b5ac5bd367f2ff2d75c12)
---
 tests/sys/vm/shared_shadow_inval_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/sys/vm/shared_shadow_inval_test.c b/tests/sys/vm/shared_shadow_inval_test.c
index 6a1e693d3455..8cd986b8ed99 100644
--- a/tests/sys/vm/shared_shadow_inval_test.c
+++ b/tests/sys/vm/shared_shadow_inval_test.c
@@ -365,7 +365,7 @@ do_shared_shadow_inval(bool lazy_cow)
 	ATF_REQUIRE(sysctllen >= sizeof(size_t));
 
 	pagesize = pagesizes[0];
-	largepagesize = sysctllen >= 2 * sizeof(size_t) ?
+	largepagesize = sysctllen >= 2 * sizeof(size_t) && pagesizes[1] != 0 ?
 	    pagesizes[1] : 2 * 1024 * 1024;
 
 	for (unsigned int i = 0; i <= FLAG_MASK; i++) {