mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-22 01:31:34 +00:00
lazy-pages: treat ENOMEM returned by UFFDIO_UNREGISTER as task exit
The UFFDIO_UNREGISTER returns ENOMEM only when it is unable to get mm_struct. We can assume in such case that the task is exited. Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
f41e386d4d
commit
0ee7df54de
1 changed files with 9 additions and 0 deletions
|
|
@ -914,6 +914,15 @@ static int handle_remove(struct lazy_pages_info *lpi, struct uffd_msg *msg)
|
|||
*/
|
||||
if (msg->event == UFFD_EVENT_REMOVE &&
|
||||
ioctl(lpi->lpfd.fd, UFFDIO_UNREGISTER, &unreg)) {
|
||||
/*
|
||||
* The kernel returns -ENOMEM when unregister is
|
||||
* called after the process has gone
|
||||
*/
|
||||
if (errno == ENOMEM) {
|
||||
handle_exit(lpi);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pr_perror("Failed to unregister (%llx - %llx)", unreg.start,
|
||||
unreg.start + unreg.len);
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue