mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-04 08:15:37 +00:00
lazy-pages: treat ESRCH returned by uffdio_copy as process exit condition
Newer kernels will report ESRCH when uffdio_copy is attempted when the process is exiting [1]. We take care of the new errno value and keep ENOSPC for compatibility. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/userfaultfd.c?id=e86b298bebf7e799e4b7232e9135799f1947552e Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
e5d7d71b1e
commit
1f2cc31fd5
@@ -688,7 +688,7 @@ static int uffd_copy(struct lazy_pages_info *lpi, __u64 address, int nr_pages)
|
|||||||
lp_debug(lpi, "uffd_copy: 0x%llx/%ld\n", uffdio_copy.dst, len);
|
lp_debug(lpi, "uffd_copy: 0x%llx/%ld\n", uffdio_copy.dst, len);
|
||||||
rc = ioctl(lpi->lpfd.fd, UFFDIO_COPY, &uffdio_copy);
|
rc = ioctl(lpi->lpfd.fd, UFFDIO_COPY, &uffdio_copy);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
if (errno == ENOSPC) {
|
if (errno == ENOSPC || errno == ESRCH) {
|
||||||
handle_exit(lpi);
|
handle_exit(lpi);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user