--- ./mm/mmap.c.vmrssfix 2005-12-13 15:30:05.000000000 +0300 +++ ./mm/mmap.c 2005-12-19 15:40:17.225126176 +0300 @@ -664,7 +664,7 @@ struct vm_area_struct *vma_merge(struct * case 7*: prev->vm_rss += area->vm_rss */ if (next && addr == next->vm_start) { /* case 5 */ - extra_rss = pages_in_vma_range(prev, addr, end); + extra_rss = pages_in_vma_range(next, addr, end); next->vm_rss -= extra_rss; } prev->vm_rss += extra_rss;