resize_area() must unmap the area beyond the new size, if the area has shrinked.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9267 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+10
-1
@@ -2592,6 +2592,15 @@ resize_area(area_id areaID, size_t newSize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
current->size = newSize;
|
current->size = newSize;
|
||||||
|
|
||||||
|
// we also need to unmap all pages beyond the new size, if the area has shrinked
|
||||||
|
if (newSize < oldSize) {
|
||||||
|
vm_translation_map *map = ¤t->aspace->translation_map;
|
||||||
|
|
||||||
|
map->ops->lock(map);
|
||||||
|
map->ops->unmap(map, current->base + newSize, current->base + oldSize - 1);
|
||||||
|
map->ops->unlock(map);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
@@ -2601,7 +2610,7 @@ resize_area(area_id areaID, size_t newSize)
|
|||||||
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
vm_cache_resize(cache, newSize);
|
vm_cache_resize(cache, newSize);
|
||||||
mutex_unlock(&cache->lock);
|
mutex_unlock(&cache->lock);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user