[CRIU] [PATCH] autofs: collect new pipe fd as used

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Wed Apr 27 06:33:06 PDT 2016


This is essential to make sure, that we won't use the same pipe descriptor for
different pipes.
Otherwise we can run into problem with fd send via unix sockets.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 criu/autofs.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/criu/autofs.c b/criu/autofs.c
index 069f67b..7669c1f 100644
--- a/criu/autofs.c
+++ b/criu/autofs.c
@@ -694,6 +694,7 @@ static int autofs_create_fle(struct pstree_item *task, FdinfoEntry *fe,
 			     struct file_desc *desc)
 {
 	struct fdinfo_list_entry *le;
+	struct rst_info *rst_info = rsti(task);
 
 	le = shmalloc(sizeof(*le) + sizeof(int));
 	if (!le)
@@ -704,7 +705,9 @@ static int autofs_create_fle(struct pstree_item *task, FdinfoEntry *fe,
 	le->pid = task->pid.virt;
 	le->fe = fe;
 
-	collect_gen_fd(le, rsti(task));
+	collect_gen_fd(le, rst_info);
+
+	collect_used_fd(le, rst_info);
 
 	list_add_tail(&le->desc_list, &desc->fd_info_head);
 	le->desc = desc;



More information about the CRIU mailing list