From: Andrew Morton Date: Fri, 23 Jun 2006 09:05:15 +0000 (-0700) Subject: [PATCH] mmput() might sleep X-Git-Tag: v2.6.18-rc1~1081^2~71 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=0ae26f1b3159f3acb21ae1e866c3c7e16edd450f;p=linux-2.6-omap-h63xx.git [PATCH] mmput() might sleep exit_aio() and exit_mmap() can sleep. But it's easy to accidentally call mmput() from inside locks. Cc: Dave Peterson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/fork.c b/kernel/fork.c index ac8100e3088..195958a3a4d 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -368,6 +368,8 @@ void fastcall __mmdrop(struct mm_struct *mm) */ void mmput(struct mm_struct *mm) { + might_sleep(); + if (atomic_dec_and_test(&mm->mm_users)) { exit_aio(mm); exit_mmap(mm);