Commit 3ad95b37 authored by Pavel Emelyanov's avatar Pavel Emelyanov

shm: Fix one task shmem remaps restore

Since the collect_shmems updates start address for vmas, for
two shared mappings in one task we'll try to dup() the 1st
restoration attempt, since the si's start will be set to the
2nd one, which is not yet restored.

Thus we should map-and-open the first one being restored, not
the one with matched address and dup() all the rest.

[avagin@: There's no such thing, since the collect stage checks
for pid being less _or_ _equal_ and this only the first vma's start
will be saved. But anyway, this makes it more obvious.]
Acked-by: 's avatarAndrey Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8e47df99
......@@ -492,7 +492,7 @@ static int get_shmem_fd(int pid, struct vma_entry *vi)
if (si->pid != pid)
return shmem_wait_and_open(pid, si);
if (si->start != vi->start)
if (si->fd != -1)
return dup(si->fd);
/* The following hack solves problems:
......
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