[CRIU] [PATCH 2/7] Skip generating iov for non PROT_READ region
Abhishek Dubey
dubeyabhishek777 at gmail.com
Wed Aug 21 02:06:57 MSK 2019
skip iov-generation corresponding to regions
not having PROT_READ, since process_vm_readv
syscall can't process them during pre-dumping
in "read" mode.
Signed-off-by: Abhishek Dubey <dubeyabhishek777 at gmail.com>
---
criu/mem.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/criu/mem.c b/criu/mem.c
index e19688d..740992d 100644
--- a/criu/mem.c
+++ b/criu/mem.c
@@ -351,7 +351,7 @@ static int generate_vma_iovs(struct pstree_item *item, struct vma_area *vma,
struct page_pipe *pp, struct page_xfer *xfer,
struct parasite_dump_pages_args *args,
struct parasite_ctl *ctl, pmc_t *pmc,
- bool has_parent, bool pre_dump)
+ bool has_parent, struct mem_dump_ctl *mdc)
{
u64 off = 0;
u64 *map;
@@ -361,8 +361,15 @@ static int generate_vma_iovs(struct pstree_item *item, struct vma_area *vma,
!vma_area_is(vma, VMA_ANON_SHARED))
return 0;
+ if (!(vma->e->prot & PROT_READ)) {
+ if (mdc->pre_dump == PRE_DUMP_READ)
+ return 0;
+ if (!mdc->pre_dump)
+ has_parent = false;
+ }
+
if (vma_entry_is(vma->e, VMA_AREA_AIORING)) {
- if (pre_dump)
+ if (mdc->pre_dump)
return 0;
has_parent = false;
}
@@ -474,7 +481,7 @@ static int __parasite_dump_pages_seized(struct pstree_item *item,
has_parent = !!xfer.parent && !possible_pid_reuse;
list_for_each_entry(vma_area, &vma_area_list->h, list) {
ret = generate_vma_iovs(item, vma_area, pp, &xfer, args, ctl,
- &pmc, has_parent, mdc->pre_dump);
+ &pmc, has_parent, mdc);
if (ret < 0)
goto out_xfer;
}
--
2.7.4
More information about the CRIU
mailing list