From b1648ead3749fd10e20466a76b7ca8b24e933dee Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 10 Jul 2003 10:02:37 -0700 Subject: [PATCH] Bug fix in AIO initialization From: "Chen, Kenneth W" We hit this bug when we have the following scenario: One process initializes an AIO context and then forks out many child processes. When those child processes exit, many BUG checks (effectively kernel oops) were triggered from put_ioctx(ctx) in function exit_aio(). The issue was that the AIO context was incorrectly copied upon forking and mislead all child processes to think they have an IO context and trying to free it where they really don't own. The following patch fix the issue. --- kernel/fork.c | 1 + 1 file changed, 1 insertion(+) (limited to 'kernel') diff --git a/kernel/fork.c b/kernel/fork.c index 96ce3385cc75..2928684629e4 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -375,6 +375,7 @@ static struct mm_struct * mm_init(struct mm_struct * mm) mm->core_waiters = 0; mm->page_table_lock = SPIN_LOCK_UNLOCKED; mm->ioctx_list_lock = RW_LOCK_UNLOCKED; + mm->ioctx_list = NULL; mm->default_kioctx = (struct kioctx)INIT_KIOCTX(mm->default_kioctx, *mm); mm->free_area_cache = TASK_UNMAPPED_BASE; -- cgit v1.2.3