[CRIU] [PATCH 14/18] unix: Use queuer id, not ino

Pavel Emelyanov xemul at virtuozzo.com
Mon Jul 10 12:41:04 MSK 2017


The sk-queue.img keeps socket IDs as recepient descriptor. For
SCM code we'll need to find the unix sk info who is the sender
for a particular other socket by this ID. There's already the
queuer field in the unix_sk_info, but it needs to be an ID
rather than inode. Fortunately, id-inode pairs are unique.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/sk-unix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index 901c74b..5665bec 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -985,7 +985,7 @@ static int post_open_unix_sk(struct file_desc *d, int fd)
 
 	revert_unix_sk_cwd(&cwd_fd, &root_fd);
 
-	if (peer->queuer == ui->ue->ino && restore_sk_queue(fd, peer->ue->id))
+	if (peer->queuer == ui->ue->id && restore_sk_queue(fd, peer->ue->id))
 		return -1;
 
 	return restore_sk_common(fd, ui);
@@ -1489,7 +1489,7 @@ static void set_peer(struct unix_sk_info *ui, struct unix_sk_info *peer)
 	ui->peer = peer;
 	list_add(&ui->node, &peer->connected);
 	if (!peer->queuer)
-		peer->queuer = ui->ue->ino;
+		peer->queuer = ui->ue->id;
 }
 
 static void interconnected_pair(struct unix_sk_info *ui, struct unix_sk_info *peer)
-- 
2.1.4



More information about the CRIU mailing list