[CRIU] [PATCH 2/7] dedup, uffd: remove -1 handling for seep_pagemap_page return value
Mike Rapoport
rppt at linux.vnet.ibm.com
Sun Nov 20 01:50:01 PST 2016
The return value of seep_pagemap_page can be either 1 (page found) or 0 (no
page found). There's no point in checking its return value for -1.
Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
criu/pagemap.c | 4 +---
criu/uffd.c | 7 +------
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/criu/pagemap.c b/criu/pagemap.c
index 06809ca..dda0ebe 100644
--- a/criu/pagemap.c
+++ b/criu/pagemap.c
@@ -98,10 +98,8 @@ int dedup_one_iovec(struct page_read *pr, struct iovec *iov)
struct page_read * prp;
ret = pr->seek_page(pr, off, false);
- if (ret == -1)
- return -1;
-
if (ret == 0) {
+ pr_err("Missing %lx in parent pagemap\n", off);
if (off < pr->cvaddr && pr->cvaddr < iov_end)
off = pr->cvaddr;
else
diff --git a/criu/uffd.c b/criu/uffd.c
index cd370aa..76028ea 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -618,16 +618,11 @@ static int uffd_seek_or_zero_pages(struct lazy_pages_info *lpi, __u64 address,
lpi->pr.reset(&lpi->pr);
- ret = lpi->pr.seek_page(&lpi->pr, address, false);
- if (ret < 0) {
- pr_err("%d: no pagemap containing %llx\n", lpi->pid, address);
- return ret;
- }
-
/*
* FIXME: rework zeroes handling so we won't need to rely on
* seek_page return value here
*/
+ ret = lpi->pr.seek_page(&lpi->pr, address, false);
if (ret == 0 || pagemap_zero(lpi->pr.pe))
return uffd_zero(lpi, address, nr);
--
1.9.1
More information about the CRIU
mailing list