浏览代码

[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 <sonny@burdell.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Sonny Rao 19 年之前
父节点
当前提交
f86c9747fe
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      arch/powerpc/mm/mmu_context_64.c

+ 2 - 0
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;
 	}