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

Submitted by Pavel Emelyanov on July 10, 2017, 9:41 a.m.

Details

Message ID c1cd2137-a39a-6c27-8417-39c39c126859@virtuozzo.com
State Accepted
Series "Support descriptors sent over unix sockets"
Headers show

Commit Message

Pavel Emelyanov July 10, 2017, 9:41 a.m.
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@virtuozzo.com>
---
 criu/sk-unix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

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)