From: Sonny Rao Date: Tue, 27 Jun 2006 12:46:09 +0000 (-0400) Subject: [POWERPC] Fix idr locking in init_new_context X-Git-Tag: v2.6.18-rc1~358^2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f86c9747fe1cd72b2c5c6bdf72d17aeb2a3c6cb0;p=linux-2.6 [POWERPC] Fix idr locking in init_new_context We always need to serialize accesses to mmu_context_idr. I hit this bug when testing with a small number of mmu contexts. Signed-off-by: Sonny Rao Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c index 65d18dca26..e2051efa09 100644 --- a/arch/powerpc/mm/mmu_context_64.c +++ b/arch/powerpc/mm/mmu_context_64.c @@ -44,7 +44,9 @@ again: return err; if (index > MAX_CONTEXT) { + spin_lock(&mmu_context_lock); idr_remove(&mmu_context_idr, index); + spin_unlock(&mmu_context_lock); return -ENOMEM; }