Skip to content

Commit

Permalink
um: Remove locking in deactivate_all_fds()
Browse files Browse the repository at this point in the history
Not only does the locking contradict the comment, and as
the comment says is pointless and actually harmful (all
the actual OS threads have exited already), but it also
causes crashes when lockdep is enabled, because calling
into the spinlock calls into lockdep, which then tries
to determine the current task, which no longer exists.

Remove the locking to let UML shut down cleanly in case
lockdep is enabled.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
jmberg-intel authored and richardweinberger committed Jul 2, 2019
1 parent 56fc187 commit 8eacd6f
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions arch/um/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,8 @@ EXPORT_SYMBOL(deactivate_fd);
*/
int deactivate_all_fds(void)
{
unsigned long flags;
struct irq_entry *to_free;

spin_lock_irqsave(&irq_lock, flags);
/* Stop IO. The IRQ loop has no lock so this is our
* only way of making sure we are safe to dispose
* of all IRQ handlers
Expand All @@ -404,7 +402,6 @@ int deactivate_all_fds(void)
to_free = to_free->next;
}
garbage_collect_irq_entries();
spin_unlock_irqrestore(&irq_lock, flags);
os_close_epoll_fd();
return 0;
}
Expand Down

0 comments on commit 8eacd6f

Please sign in to comment.