2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

restore: Add some more comments

Add comments on real_pid member and pipe users counters.

Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov
2011-10-13 17:31:52 +04:00
parent 8b122598fe
commit d2f505f52c

View File

@@ -36,6 +36,14 @@ struct fmap_fd {
int fd;
};
/*
* Some shared memory entries and pipe entries are created
* only in one process and got shared by others. Because of
* this the real_pid member is used. It serves like a synchronization
* point -- the process which creates a particular entity does set
* real_pid member and all other users do wait until this member is set.
*/
struct shmem_info {
unsigned long start;
unsigned long end;
@@ -914,7 +922,11 @@ static int create_pipe(int pid, struct pipe_entry *e, struct pipe_info *pi, int
pi->write_fd = pfd[1];
pi->real_pid = getpid();
/* The process used both pipe ends */
/*
* FIXME: xemul@ reported that this actually
* would not work if a task keeps pipe many times
* not just two. Need to review and fix propery.
*/
if (pipe_is_rw(pi))
minusers = 2;