Skip to content

Commit 7201280

Browse files
authored
Merge pull request #746 from uvletter/fix_vtoslab
Fix vtoslab doesn't return the correct slab
2 parents 8020e26 + 5ed6bae commit 7201280

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/include/vm/uma_int.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ vtoslab(vm_offset_t va)
7676

7777
hash_list = &uma_page_slab_hash[UMA_PAGE_HASH(va)];
7878
LIST_FOREACH(up, hash_list, list_entry)
79-
if (up->up_va == va)
79+
if (up->up_va == (va & (~(PAGE_SIZE - 1))))
8080
return (up->up_slab);
8181
return (NULL);
8282
}
@@ -89,7 +89,7 @@ vtozoneslab(vm_offset_t va, uma_zone_t *zone, uma_slab_t *slab)
8989

9090
hash_list = &uma_page_slab_hash[UMA_PAGE_HASH(va)];
9191
LIST_FOREACH(up, hash_list, list_entry)
92-
if (up->up_va == va)
92+
if (up->up_va == (va & (~(PAGE_SIZE - 1))))
9393
break;
9494

9595
*slab = up->up_slab;

0 commit comments

Comments
 (0)