mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[PATCH] don't do exit_io_context() until we know we won't be doing any IO
testcase: mount /dev/sdb10 /mnt touch /mnt/tmp/b umount /mnt mount /dev/sdb10 /mnt rm /mnt/tmp/b </mnt/tmp/b umount /mnt and watch blkdev_ioc line in /proc/slabinfo. Vanilla kernel leaks. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
60a6dc55b9
commit
afc847b7dd
1 changed files with 5 additions and 2 deletions
|
@ -807,8 +807,6 @@ fastcall NORET_TYPE void do_exit(long code)
|
||||||
panic("Attempted to kill the idle task!");
|
panic("Attempted to kill the idle task!");
|
||||||
if (unlikely(tsk->pid == 1))
|
if (unlikely(tsk->pid == 1))
|
||||||
panic("Attempted to kill init!");
|
panic("Attempted to kill init!");
|
||||||
if (tsk->io_context)
|
|
||||||
exit_io_context();
|
|
||||||
|
|
||||||
if (unlikely(current->ptrace & PT_TRACE_EXIT)) {
|
if (unlikely(current->ptrace & PT_TRACE_EXIT)) {
|
||||||
current->ptrace_message = code;
|
current->ptrace_message = code;
|
||||||
|
@ -822,6 +820,8 @@ fastcall NORET_TYPE void do_exit(long code)
|
||||||
if (unlikely(tsk->flags & PF_EXITING)) {
|
if (unlikely(tsk->flags & PF_EXITING)) {
|
||||||
printk(KERN_ALERT
|
printk(KERN_ALERT
|
||||||
"Fixing recursive fault but reboot is needed!\n");
|
"Fixing recursive fault but reboot is needed!\n");
|
||||||
|
if (tsk->io_context)
|
||||||
|
exit_io_context();
|
||||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
set_current_state(TASK_UNINTERRUPTIBLE);
|
||||||
schedule();
|
schedule();
|
||||||
}
|
}
|
||||||
|
@ -881,6 +881,9 @@ fastcall NORET_TYPE void do_exit(long code)
|
||||||
*/
|
*/
|
||||||
mutex_debug_check_no_locks_held(tsk);
|
mutex_debug_check_no_locks_held(tsk);
|
||||||
|
|
||||||
|
if (tsk->io_context)
|
||||||
|
exit_io_context();
|
||||||
|
|
||||||
/* PF_DEAD causes final put_task_struct after we schedule. */
|
/* PF_DEAD causes final put_task_struct after we schedule. */
|
||||||
preempt_disable();
|
preempt_disable();
|
||||||
BUG_ON(tsk->flags & PF_DEAD);
|
BUG_ON(tsk->flags & PF_DEAD);
|
||||||
|
|
Loading…
Reference in a new issue