Commit 8ed215d2 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

proc_parse: Borrow vmi iif there is file referenced

Otherwise we migh propagate previous vfi status
to vmas which actually don't match.

 | (00.005471) 0x2b79227d6000-0x2b79227d8000 (8K) prot 0x5 flags 0x22 off 0 reg vdso ap  shmid: 0
 | (00.005473) 0x2b79227d8000-0x2b79227da000 (8K) prot 0x3 flags 0x22 off 0 reg vdso ap  shmid: 0
 | (00.005475) 0x2b79227f1000-0x2b79227f2000 (4K) prot 0x3 flags 0x22 off 0 reg vdso ap  shmid: 0
 | (00.005476) 0x2b79227f2000-0x2b79227f4000 (8K) prot 0x3 flags 0x22 off 0 reg vdso ap  shmid: 0
Tested-by: 's avatarPavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent c3d71138
......@@ -172,6 +172,13 @@ static int vma_get_mapfile(struct vma_area *vma, DIR *mfd,
if (prev_vfi->vma && vfi_equal(vfi, prev_vfi)) {
struct vma_area *prev = prev_vfi->vma;
/*
* If vfi is equal (!) and negative @vm_file_fd --
* we have nothing to borrow for sure.
*/
if (prev->vm_file_fd < 0)
return 0;
pr_debug("vma %"PRIx64" borrows vfi from previous %"PRIx64"\n",
vma->e->start, prev->e->start);
vma->vm_file_fd = prev->vm_file_fd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment