提交 557c2d8a 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

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: NOleg 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b8c20a9b
...@@ -184,11 +184,14 @@ static void *m_start(struct seq_file *m, loff_t *ppos) ...@@ -184,11 +184,14 @@ static void *m_start(struct seq_file *m, loff_t *ppos)
m->version = 0; m->version = 0;
if (pos < mm->map_count) { 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; vma = vma->vm_next;
}
return vma; return vma;
} }
/* we do not bother to update m->version in this case */
if (pos == mm->map_count && priv->tail_vma) if (pos == mm->map_count && priv->tail_vma)
return priv->tail_vma; return priv->tail_vma;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册