Re: [PATCH v2 1/3 gnumach] vm_map: Add comment and assert for vm_map_delete

2024-02-22 Thread Samuel Thibault
Hello, Damien Zammit, le jeu. 22 févr. 2024 08:24:25 +, a ecrit: > + /* > + * Must be called with map lock taken unless refcount is zero > + */ > + assert((map->ref_count > 0 && map->lock.want_write) || (map->ref_count > == 0)); Please rather use have_write_lock(). (w

[PATCH v2 1/3 gnumach] vm_map: Add comment and assert for vm_map_delete

2024-02-22 Thread Damien Zammit
This will prevent calling vm_map_delete without the map locked unless ref_count is zero. --- vm/vm_map.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/vm/vm_map.c b/vm/vm_map.c index e454bb2a..f221c532 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -551,10 +551,12 @@ void vm_map_deallo