<div dir="ltr">Pls, watch patch</div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><br>Best Regards, Tikhomirov Pavel.</div></div>
<br><br><div class="gmail_quote">2014-04-16 17:05 GMT+04:00 Tikhomirov Pavel <span dir="ltr"><<a href="mailto:snorcht@gmail.com" target="_blank">snorcht@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
here was bug cause if e.g.: iterative snapshots are made and<br>
between two of them new process in process tree was created,<br>
it can have pages which are non dirty, and won't save them<br>
into image. but there is no parent image for it.<br>
<br>
pages which are non soft-dirty appear if process with some pages<br>
in non dirty state forks, child will inherit those pte's<br>
and if child don't write to those pages, they will be still in non<br>
soft-dirty state when next dump comes.<br>
<br>
also this bug was not catched because of error in zdtm, look 3/3<br>
<br>
v2: simplify, add more justification in commit message.<br>
<br>
Signed-off-by: Tikhomirov Pavel <<a href="mailto:snorcht@gmail.com">snorcht@gmail.com</a>><br>
---<br>
mem.c | 6 +++---<br>
1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/mem.c b/mem.c<br>
index ef1d010..46dee60 100644<br>
--- a/mem.c<br>
+++ b/mem.c<br>
@@ -106,7 +106,7 @@ static inline bool page_in_parent(u64 pme)<br>
* the memory contents is present in the pagent image set.<br>
*/<br>
<br>
-static int generate_iovs(struct vma_area *vma, struct page_pipe *pp, u64 *map, u64 *off)<br>
+static int generate_iovs(struct vma_area *vma, struct page_pipe *pp, u64 *map, u64 *off, bool parent)<br>
{<br>
u64 *at = &map[PAGE_PFN(*off)];<br>
unsigned long pfn, nr_to_scan;<br>
@@ -130,7 +130,7 @@ static int generate_iovs(struct vma_area *vma, struct page_pipe *pp, u64 *map, u<br>
* page. The latter would be checked in page-xfer.<br>
*/<br>
<br>
- if (page_in_parent(at[pfn])) {<br>
+ if (page_in_parent(at[pfn]) && parent) {<br>
ret = page_pipe_add_hole(pp, vaddr);<br>
pages[0]++;<br>
} else {<br>
@@ -282,7 +282,7 @@ static int __parasite_dump_pages_seized(struct parasite_ctl *ctl,<br>
if (!map)<br>
goto out_xfer;<br>
again:<br>
- ret = generate_iovs(vma_area, pp, map, &off);<br>
+ ret = generate_iovs(vma_area, pp, map, &off, xfer.parent);<br>
if (ret == -EAGAIN) {<br>
BUG_ON(pp_ret);<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.8.3.2<br>
<br>
</font></span></blockquote></div><br></div>