From e99c57b1ea677967f764869c508467b945189fca Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Mon, 21 Dec 2020 20:57:38 -0500 Subject: [PATCH] fs/proc/task_mmu: Fix mas_reset stuff Signed-off-by: Liam R. Howlett --- fs/proc/task_mmu.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index a331120a1cd3..501d27ae2b77 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -867,10 +867,7 @@ static int show_smaps_rollup(struct seq_file *m, void *v) if (vma) vma_start = vma->vm_start; - mas_reset(&mas); mas_set(&mas, 0); - - mas_for_each(&mas, vma, -1) { smap_gather_stats(vma, &mss, 0); last_vma_end = vma->vm_end; @@ -924,7 +921,7 @@ static int show_smaps_rollup(struct seq_file *m, void *v) * contains last_vma_end. * Iterate VMA' from last_vma_end. */ - mas_set(&mas, last_vma_end - 1); + mas.index = mas.last = last_vma_end - 1; vma = mas_find(&mas, -1); /* Case 3 above */ if (!vma) @@ -1251,7 +1248,6 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf, count = -EINTR; goto out_mm; } - mas_reset(&mas); mas_set(&mas, 0); mas_for_each(&mas, vma, ULONG_MAX) { vma->vm_flags &= ~VM_SOFTDIRTY; -- 2.50.1