mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
files: Allow to send unix sockets over unix sockets
Everything is ready. Message queue restores are in the second stage of open for all types of unix sockets. We just need to make scm wait before restore_unix_queue() and allow to dump such scm context. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
fdb7bde5c7
commit
75be843cdd
2 changed files with 6 additions and 15 deletions
|
|
@ -100,15 +100,6 @@ static int dump_scm_rights(struct cmsghdr *ch, SkPacketEntry *pe)
|
|||
|
||||
if (dump_my_file(fds[i], &scme->rights[i], &ftyp))
|
||||
return -1;
|
||||
|
||||
/*
|
||||
* Unix sent over Unix are tricky and not supported
|
||||
* for now. (XXX -- todo).
|
||||
*/
|
||||
if (ftyp == FD_TYPES__UNIXSK) {
|
||||
pr_err("Can't dump send %d (unix/epoll) fd\n", ftyp);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
i = pe->n_scm++;
|
||||
|
|
|
|||
|
|
@ -1123,6 +1123,9 @@ static int post_open_standalone(struct file_desc *d, int fd)
|
|||
BUG_ON((ui->flags & (USK_PAIR_MASTER | USK_PAIR_SLAVE)) ||
|
||||
(ui->ue->uflags & (USK_CALLBACK | USK_INHERIT)));
|
||||
|
||||
if (chk_restored_scms(ui))
|
||||
return 1;
|
||||
|
||||
peer = ui->peer;
|
||||
if (!peer || ui->is_connected)
|
||||
goto restore_sk_common;
|
||||
|
|
@ -1292,6 +1295,9 @@ static int post_open_interconnected_master(struct unix_sk_info *ui)
|
|||
fle_peer = file_master(&peer->d);
|
||||
BUG_ON(fle->task != fle_peer->task); /* See interconnected_pair() */
|
||||
|
||||
if (chk_restored_scms(ui) || chk_restored_scms(peer))
|
||||
return 0;
|
||||
|
||||
if (restore_unix_queue(fle->fe->fd, peer))
|
||||
return -1;
|
||||
|
||||
|
|
@ -1563,12 +1569,6 @@ static int open_unix_sk(struct file_desc *d, int *new_fd)
|
|||
|
||||
ui = container_of(d, struct unix_sk_info, d);
|
||||
|
||||
/* FIXME -- only queue restore may be postponed */
|
||||
if (chk_restored_scms(ui)) {
|
||||
pr_info("scm: Wait for tgt to restore\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (inherited_fd(d, new_fd)) {
|
||||
ui->ue->uflags |= USK_INHERIT;
|
||||
ret = *new_fd >= 0 ? 0 : -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue