aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/mmap.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index 69d4c5199fd8..c9bc285df255 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -368,16 +368,18 @@ static int browse_rb(struct rb_root *root)
368 struct vm_area_struct *vma; 368 struct vm_area_struct *vma;
369 vma = rb_entry(nd, struct vm_area_struct, vm_rb); 369 vma = rb_entry(nd, struct vm_area_struct, vm_rb);
370 if (vma->vm_start < prev) { 370 if (vma->vm_start < prev) {
371 pr_emerg("vm_start %lx prev %lx\n", vma->vm_start, prev); 371 pr_emerg("vm_start %lx < prev %lx\n",
372 vma->vm_start, prev);
372 bug = 1; 373 bug = 1;
373 } 374 }
374 if (vma->vm_start < pend) { 375 if (vma->vm_start < pend) {
375 pr_emerg("vm_start %lx pend %lx\n", vma->vm_start, pend); 376 pr_emerg("vm_start %lx < pend %lx\n",
377 vma->vm_start, pend);
376 bug = 1; 378 bug = 1;
377 } 379 }
378 if (vma->vm_start > vma->vm_end) { 380 if (vma->vm_start > vma->vm_end) {
379 pr_emerg("vm_end %lx < vm_start %lx\n", 381 pr_emerg("vm_start %lx > vm_end %lx\n",
380 vma->vm_end, vma->vm_start); 382 vma->vm_start, vma->vm_end);
381 bug = 1; 383 bug = 1;
382 } 384 }
383 if (vma->rb_subtree_gap != vma_compute_subtree_gap(vma)) { 385 if (vma->rb_subtree_gap != vma_compute_subtree_gap(vma)) {
@@ -419,8 +421,10 @@ static void validate_mm(struct mm_struct *mm)
419 int i = 0; 421 int i = 0;
420 unsigned long highest_address = 0; 422 unsigned long highest_address = 0;
421 struct vm_area_struct *vma = mm->mmap; 423 struct vm_area_struct *vma = mm->mmap;
424
422 while (vma) { 425 while (vma) {
423 struct anon_vma_chain *avc; 426 struct anon_vma_chain *avc;
427
424 vma_lock_anon_vma(vma); 428 vma_lock_anon_vma(vma);
425 list_for_each_entry(avc, &vma->anon_vma_chain, same_vma) 429 list_for_each_entry(avc, &vma->anon_vma_chain, same_vma)
426 anon_vma_interval_tree_verify(avc); 430 anon_vma_interval_tree_verify(avc);
@@ -435,12 +439,13 @@ static void validate_mm(struct mm_struct *mm)
435 } 439 }
436 if (highest_address != mm->highest_vm_end) { 440 if (highest_address != mm->highest_vm_end) {
437 pr_emerg("mm->highest_vm_end %lx, found %lx\n", 441 pr_emerg("mm->highest_vm_end %lx, found %lx\n",
438 mm->highest_vm_end, highest_address); 442 mm->highest_vm_end, highest_address);
439 bug = 1; 443 bug = 1;
440 } 444 }
441 i = browse_rb(&mm->mm_rb); 445 i = browse_rb(&mm->mm_rb);
442 if (i != mm->map_count) { 446 if (i != mm->map_count) {
443 pr_emerg("map_count %d rb %d\n", mm->map_count, i); 447 if (i != -1)
448 pr_emerg("map_count %d rb %d\n", mm->map_count, i);
444 bug = 1; 449 bug = 1;
445 } 450 }
446 BUG_ON(bug); 451 BUG_ON(bug);