<div dir="ltr">Sorry, missed CRML.<br>
<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Pavel Tikhomirov</b> <span dir="ltr"><<a href="mailto:snorcht@gmail.com">snorcht@gmail.com</a>></span><br>
Date: 2014-04-18 14:11 GMT+04:00<br>Subject: Re: [PATCH] page-xfer: repair bug with check_pagehole_in_parent<br>To: Pavel Emelyanov <<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>><br><br><br><div dir="ltr">
I don't think that we need some special test. This patch only checks on dumping hole that in parent images data for that hole exists.</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-18 14:06 GMT+04:00 Pavel Tikhomirov <span dir="ltr"><<a href="mailto:snorcht@gmail.com" target="_blank">snorcht@gmail.com</a>></span>:<div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">It all don't create real bug now. It just don't checks, what it really need to check, as I thought.<div><br></div><div>I try to use <span style="font-family:arial,sans-serif;font-size:13px">check_pagehole_in_parent in dedup on unmap patch which I sent before, and</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">this correction is critical for it.</span></div></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-18 14:00 GMT+04:00 Pavel Emelyanov <span dir="ltr"><<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>></span>:<div><div><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On 04/18/2014 01:50 PM, Tikhomirov Pavel wrote:<br>
> 1)it didn't find real pages it had only one step into iterative snapshots<br>
> but what if real page is on the third level?<br>
><br>
> patch adds recoursive check in previous images<br>
><br>
> 2)it did provide whole intersected pagemap, but it will be more<br>
> convinient to print only intersection part.<br>
<br>
</div>Was this all was caught by zdtm? If no, then it's worth creating<br>
a stress test on stackable images. Would you?<br>
<div><div><br>
> Signed-off-by: Tikhomirov Pavel <<a href="mailto:snorcht@gmail.com" target="_blank">snorcht@gmail.com</a>><br>
> ---<br>
> page-xfer.c | 18 +++++++++++++++---<br>
> 1 file changed, 15 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/page-xfer.c b/page-xfer.c<br>
> index 56e8575..0678b54 100644<br>
> --- a/page-xfer.c<br>
> +++ b/page-xfer.c<br>
> @@ -504,7 +504,7 @@ static int check_pagehole_in_parent(struct page_read *p, struct iovec *iov)<br>
> off = (unsigned long)iov->iov_base;<br>
> end = off + iov->iov_len;<br>
> while (1) {<br>
> - struct iovec piov;<br>
> + struct iovec piov, tiov;<br>
> unsigned long pend;<br>
><br>
> ret = seek_pagemap_page(p, off, true);<br>
> @@ -512,7 +512,20 @@ static int check_pagehole_in_parent(struct page_read *p, struct iovec *iov)<br>
> return -1;<br>
><br>
> pagemap2iovec(p->pe, &piov);<br>
> - pr_debug("\tFound %p/%zu\n", piov.iov_base, piov.iov_len);<br>
> + pend = (unsigned long)piov.iov_base + piov.iov_len;<br>
> +<br>
> + tiov.iov_base = (void*)off;<br>
> + tiov.iov_len = min(pend, end) - off;<br>
> + if (!p->pe->in_parent) {<br>
> + pr_debug("\tFound %p/%zu\n", tiov.iov_base, tiov.iov_len);<br>
> + } else {<br>
> + if (p->parent)<br>
> + check_pagehole_in_parent(p->parent, &tiov);<br>
> + else {<br>
> + pr_err("No parent, though pagemap is in_parent");<br>
> + return -1;<br>
> + }<br>
> + }<br>
><br>
> /*<br>
> * The pagemap entry in parent may heppen to be<br>
> @@ -520,7 +533,6 @@ static int check_pagehole_in_parent(struct page_read *p, struct iovec *iov)<br>
> * we should go ahead and check the remainder.<br>
> */<br>
><br>
> - pend = (unsigned long)piov.iov_base + piov.iov_len;<br>
> if (end <= pend)<br>
> return 0;<br>
><br>
><br>
<br>
<br>
</div></div></blockquote></div></div></div><br></div>
</blockquote></div></div></div><br></div>
</div><br></div>