mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 10:16:41 +00:00
lazy-pages: return to epoll_wait after completing forks
If we get fork() event just before transferring last IOV of the parent process, continuing to background fetch after completing fork event handling will cause lazy-pages daemon to exit and nothing will monitor the child process memory. Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
dd3704a644
commit
9cb20327aa
1 changed files with 5 additions and 2 deletions
|
|
@ -1062,7 +1062,7 @@ static int complete_forks(int epollfd, struct epoll_event **events, int *nr_fds)
|
|||
struct lazy_pages_info *lpi, *n;
|
||||
|
||||
if (list_empty(&pending_lpis))
|
||||
return 0;
|
||||
return 1;
|
||||
|
||||
list_for_each_entry(lpi, &pending_lpis, l)
|
||||
(*nr_fds)++;
|
||||
|
|
@ -1195,12 +1195,15 @@ static int handle_requests(int epollfd, struct epoll_event *events, int nr_fds)
|
|||
goto out;
|
||||
if (ret > 0) {
|
||||
ret = complete_forks(epollfd, &events, &nr_fds);
|
||||
if (ret)
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
if (!restore_finished)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* make sure we return success if there is nothing to xfer */
|
||||
ret = 0;
|
||||
|
||||
poll_timeout = 0;
|
||||
list_for_each_entry_safe(lpi, n, &lpis, l) {
|
||||
if (!list_empty(&lpi->iovs) && list_empty(&lpi->reqs)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue