Skip to content

Commit

Permalink
fs/proc/task_mmu.c: update m->version in the main loop in m_start()
Browse files Browse the repository at this point in the history
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 <oleg@redhat.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Oct 10, 2014
1 parent b8c20a9 commit 557c2d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/proc/task_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 557c2d8

Please sign in to comment.