]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] mmput() might sleep
authorAndrew Morton <akpm@osdl.org>
Fri, 23 Jun 2006 09:05:15 +0000 (02:05 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 23 Jun 2006 14:43:03 +0000 (07:43 -0700)
exit_aio() and exit_mmap() can sleep.  But it's easy to accidentally call
mmput() from inside locks.

Cc: Dave Peterson <dsp@llnl.gov>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/fork.c

index ac8100e3088a1f6d99d8ad640a70a3de5ec96e5e..195958a3a4d6ff0405ed8dcf019cecfddfb363fb 100644 (file)
@@ -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);