Fix vfs_procgroup_cleanup not handling hash collisions
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user