Fix vfs_procgroup_cleanup not handling hash collisions

This commit is contained in:
2026-02-21 22:38:50 +01:00
parent 02e77b5c90
commit 38d807f941

View File

@@ -168,16 +168,21 @@ void vfs_procgroup_cleanup (struct procgroup* procgroup) {
for (size_t i = 0; i < lengthof (mount_table.mountpoint_buckets); i++) { for (size_t i = 0; i < lengthof (mount_table.mountpoint_buckets); i++) {
struct hash_node_link* link = mount_table.mountpoint_buckets[i]; struct hash_node_link* link = mount_table.mountpoint_buckets[i];
struct vfs_mountpoint* vmp = hash_entry (link, struct vfs_mountpoint, mount_table_link);
spin_lock (&vmp->lock); while (link != NULL) {
struct vfs_mountpoint* vmp = hash_entry (link, struct vfs_mountpoint, mount_table_link);
if (vmp->ownerpg == procgroup) { spin_lock (&vmp->lock);
vmp->locked = false;
vmp->ownerpg = NULL; if (vmp->ownerpg == procgroup) {
vmp->locked = false;
vmp->ownerpg = NULL;
}
spin_unlock (&vmp->lock);
link = link->next;
} }
spin_unlock (&vmp->lock);
} }
spin_unlock (&mount_table.lock); spin_unlock (&mount_table.lock);