fix that vtoslab doesn't return the correct slab

This commit is contained in:
zhutian 2023-03-03 21:01:53 +08:00
parent 8020e2669c
commit 5ed6baeedb
1 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ vtoslab(vm_offset_t va)
hash_list = &uma_page_slab_hash[UMA_PAGE_HASH(va)];
LIST_FOREACH(up, hash_list, list_entry)
if (up->up_va == va)
if (up->up_va == (va & (~(PAGE_SIZE - 1))))
return (up->up_slab);
return (NULL);
}
@ -89,7 +89,7 @@ vtozoneslab(vm_offset_t va, uma_zone_t *zone, uma_slab_t *slab)
hash_list = &uma_page_slab_hash[UMA_PAGE_HASH(va)];
LIST_FOREACH(up, hash_list, list_entry)
if (up->up_va == va)
if (up->up_va == (va & (~(PAGE_SIZE - 1))))
break;
*slab = up->up_slab;