]> err.no Git - linux-2.6/commitdiff
[POWERPC] Fix idr locking in init_new_context
authorSonny Rao <sonny@burdell.org>
Tue, 27 Jun 2006 12:46:09 +0000 (08:46 -0400)
committerPaul Mackerras <paulus@samba.org>
Thu, 29 Jun 2006 06:22:46 +0000 (16:22 +1000)
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 <sonny@burdell.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/mm/mmu_context_64.c

index 65d18dca266ff0e3b26ed1212ca3da5990ee150c..e2051efa09c58d413d95814615c94f2d683b8b22 100644 (file)
@@ -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;
        }