From: Oleg Nesterov Date: Thu, 9 Oct 2014 22:25:43 +0000 (-0700) Subject: fs/proc/task_mmu.c: update m->version in the main loop in m_start() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=557c2d8a73dc078817ba6949697ceb8c0f3f7362;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git fs/proc/task_mmu.c: update m->version in the main loop in m_start() Change the main loop in m_start() to update m->version. Mostly for consistency, but this can help to avoid the same loop if the very 1st ->show() fails due to seq_overflow(). Signed-off-by: Oleg Nesterov Cc: Kirill A. Shutemov Cc: Cyrill Gorcunov Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index c7228c2326d1..34d93a1cdeec 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -184,11 +184,14 @@ static void *m_start(struct seq_file *m, loff_t *ppos) m->version = 0; if (pos < mm->map_count) { - for (vma = mm->mmap; pos; pos--) + for (vma = mm->mmap; pos; pos--) { + m->version = vma->vm_start; vma = vma->vm_next; + } return vma; } + /* we do not bother to update m->version in this case */ if (pos == mm->map_count && priv->tail_vma) return priv->tail_vma;