2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

lazy-pages: actually return to epoll_wait after completing forks

Commit 9cb20327aa ("return to epoll_wait after completing forks") was only
half way there. Adding the other half.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Mike Rapoport
2018-04-30 18:17:53 +03:00
committed by Andrei Vagin
parent 43c3772334
commit e77df5abd8

View File

@@ -1066,6 +1066,11 @@ out:
return -1;
}
/*
* We may exit epoll_run_rfds() loop because of non-fork() event. In
* such case we return 1 rather than 0 to let the caller know that no
* fork() events were pending
*/
static int complete_forks(int epollfd, struct epoll_event **events, int *nr_fds)
{
struct lazy_pages_info *lpi, *n;
@@ -1206,7 +1211,7 @@ static int handle_requests(int epollfd, struct epoll_event *events, int nr_fds)
ret = complete_forks(epollfd, &events, &nr_fds);
if (ret < 0)
goto out;
if (!restore_finished)
if (!restore_finished || !ret)
continue;
}