Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix clear_refs_write() use of struct mm_walk

Don't use a static entry, so as to prevent races during concurrent use
of this function.

Reported-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrew Morton and committed by
Linus Torvalds
20cbc972 fbe08257

+4 -4
+4 -4
fs/proc/task_mmu.c
··· 476 476 return -ESRCH; 477 477 mm = get_task_mm(task); 478 478 if (mm) { 479 - static struct mm_walk clear_refs_walk; 480 - memset(&clear_refs_walk, 0, sizeof(clear_refs_walk)); 481 - clear_refs_walk.pmd_entry = clear_refs_pte_range; 482 - clear_refs_walk.mm = mm; 479 + struct mm_walk clear_refs_walk = { 480 + .pmd_entry = clear_refs_pte_range, 481 + .mm = mm, 482 + }; 483 483 down_read(&mm->mmap_sem); 484 484 for (vma = mm->mmap; vma; vma = vma->vm_next) { 485 485 clear_refs_walk.private = vma;