Skip to content

Commit

Permalink
[POWERPC] Fix idr locking in init_new_context
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sonny Rao authored and Paul Mackerras committed Jun 29, 2006
1 parent 975b365 commit f86c974
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/mm/mmu_context_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
return err;

if (index > MAX_CONTEXT) {
spin_lock(&mmu_context_lock);
idr_remove(&mmu_context_idr, index);
spin_unlock(&mmu_context_lock);
return -ENOMEM;
}

Expand Down

0 comments on commit f86c974

Please sign in to comment.