summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2014-09-10 09:40:19 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2014-09-10 09:40:19 +1000
commit08c97e01bdb0ae8b4cba1e02fc0c1107e390a688 (patch)
tree00cd259bdaa27860b7124b62c8f2c56380a0b97f /fs
parent8357188aef147f1fcd52f1d0f6746ea2cf6d5403 (diff)
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 <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>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/task_mmu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index f4190629f056..aceff2da0991 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;