diff --git a/proc_parse.c b/proc_parse.c index 297914246..c8034c1cd 100644 --- a/proc_parse.c +++ b/proc_parse.c @@ -543,7 +543,15 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list) vma_area->e->status |= VMA_FILE_SHARED; } - if (get_fd_mntid(vma_area->vm_file_fd, &vma_area->mnt_id)) + /* + * We cannot use the mnt_id value provided by the kernel + * for vm_file_fd if it is an AUFS file (the value is + * wrong). In such a case, fixup_aufs_vma_fd() has set + * mnt_id to -1 to mimic pre-3.15 kernels that didn't + * have mnt_id. + */ + if (vma_area->mnt_id != -1 && + get_fd_mntid(vma_area->vm_file_fd, &vma_area->mnt_id)) return -1; } else { /* diff --git a/sysfs_parse.c b/sysfs_parse.c index c5881d05d..93b527d8d 100644 --- a/sysfs_parse.c +++ b/sysfs_parse.c @@ -262,7 +262,8 @@ err: /* * AUFS support to compensate for the kernel bug - * exposing branch pathnames in map_files. + * exposing branch pathnames in map_files and providing + * a wrong mnt_id value in /proc//fdinfo/. * * If the link points inside a branch, save the * relative pathname from the root of the mount @@ -304,6 +305,8 @@ int fixup_aufs_vma_fd(struct vma_area *vma) return -1; } + /* tell parse_smap() not to call get_fd_mntid() */ + vma->mnt_id = -1; return len; }