aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2014-10-09 18:25:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-09 22:25:49 -0400
commit557c2d8a73dc078817ba6949697ceb8c0f3f7362 (patch)
treed9e8b719e407e94ae69dba39ad9d3937187251df /fs/proc
parentb8c20a9b85b057c850f63ee4c63531a356d8596a (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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-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 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)
184 184
185 m->version = 0; 185 m->version = 0;
186 if (pos < mm->map_count) { 186 if (pos < mm->map_count) {
187 for (vma = mm->mmap; pos; pos--) 187 for (vma = mm->mmap; pos; pos--) {
188 m->version = vma->vm_start;
188 vma = vma->vm_next; 189 vma = vma->vm_next;
190 }
189 return vma; 191 return vma;
190 } 192 }
191 193
194 /* we do not bother to update m->version in this case */
192 if (pos == mm->map_count && priv->tail_vma) 195 if (pos == mm->map_count && priv->tail_vma)
193 return priv->tail_vma; 196 return priv->tail_vma;
194 197