<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-06-28 16:32 GMT+03:00 Pavel Emelyanov <span dir="ltr">&lt;<a href="mailto:xemul@virtuozzo.com" target="_blank">xemul@virtuozzo.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">On 06/24/2016 11:38 PM, Eugene Batalov wrote:<br>
&gt; Signed-off-by: Eugene Batalov &lt;<a href="mailto:eabatalov89@gmail.com">eabatalov89@gmail.com</a>&gt;<br>
&gt; ---<br>
&gt;  criu/files-reg.c | 34 +++++++++++++++++++++++-----------<br>
&gt;  1 file changed, 23 insertions(+), 11 deletions(-)<br>
&gt;<br>
&gt; diff --git a/criu/files-reg.c b/criu/files-reg.c<br>
&gt; index 2f1c695..2b6a876 100644<br>
&gt; --- a/criu/files-reg.c<br>
&gt; +++ b/criu/files-reg.c<br>
&gt; @@ -522,6 +522,26 @@ static void try_clean_ghost(struct remap_info *ri)<br>
&gt;       pr_perror(&quot; `- XFail [%s] ghost&quot;, path);<br>
&gt;  }<br>
&gt;<br>
&gt; +static int clean_one_remap(struct file_remap *remap, int rmntns_root)<br>
&gt; +{<br>
&gt; +     int ret = 0;<br>
&gt; +     if (rmntns_root == -1)<br>
&gt; +             rmntns_root = mntns_get_root_by_mnt_id(remap-&gt;rmnt_id);<br>
&gt; +<br>
&gt; +     if (rmntns_root &lt; 0)<br>
&gt; +             return -1;<br>
&gt; +<br>
&gt; +     pr_info(&quot;Unlink remap %s\n&quot;, remap-&gt;rpath);<br>
&gt; +<br>
&gt; +     ret = unlinkat(rmntns_root, remap-&gt;rpath, remap-&gt;is_dir ? AT_REMOVEDIR : 0);<br>
&gt; +     if (ret &lt; 0) {<br>
&gt; +             pr_perror(&quot;Couldn&#39;t unlink remap %s&quot;, remap-&gt;rpath);<br>
&gt; +             return -1;<br>
&gt; +     }<br>
&gt; +<br>
&gt; +     return 0;<br>
&gt; +}<br>
&gt; +<br>
&gt;  void try_clean_remaps(int ns_fd)<br>
&gt;  {<br>
&gt;       struct remap_info *ri;<br>
&gt; @@ -647,14 +667,8 @@ static int dump_ghost_file(int _fd, u32 id, const struct stat *st, dev_t phys_de<br>
&gt;  void remap_put(struct file_remap *remap)<br>
&gt;  {<br>
&gt;       mutex_lock(ghost_file_mutex);<br>
&gt; -     if (--remap-&gt;users == 0) {<br>
&gt; -             int mntns_root;<br>
&gt; -<br>
&gt; -             pr_info(&quot;Unlink the ghost %s\n&quot;, remap-&gt;rpath);<br>
&gt; -<br>
&gt; -             mntns_root = mntns_get_root_by_mnt_id(remap-&gt;rmnt_id);<br>
&gt; -             unlinkat(mntns_root, remap-&gt;rpath, 0);<br>
&gt; -     }<br>
&gt; +     if (--remap-&gt;users == 0)<br>
&gt; +             clean_one_remap(remap, -1);<br>
&gt;       mutex_unlock(ghost_file_mutex);<br>
&gt;  }<br>
&gt;<br>
&gt; @@ -1514,9 +1528,7 @@ ext:<br>
&gt;<br>
&gt;               BUG_ON(!rfi-&gt;remap-&gt;users);<br>
&gt;               if (--rfi-&gt;remap-&gt;users == 0) {<br>
&gt; -                     pr_info(&quot;Unlink the ghost %s\n&quot;, rfi-&gt;remap-&gt;rpath);<br>
&gt; -                     mntns_root = mntns_get_root_by_mnt_id(rfi-&gt;remap-&gt;rmnt_id);<br>
&gt; -                     unlinkat(mntns_root, rfi-&gt;remap-&gt;rpath, rfi-&gt;remap-&gt;is_dir ? AT_REMOVEDIR : 0);<br>
&gt; +                     clean_one_remap(rfi-&gt;remap, mntns_root);<br>
<br>
</div></div>You change the behavior -- originall the mntns_root was re-initialized, but<br>
this patch forces it to get reused. Is that OK?<br></blockquote><div>No it&#39;s not right.</div><div>mntns_root before this hunk is initialized from rfi-&gt;rfe-&gt;mnt_id but in this hunk it should be initialized from <span style="color:rgb(80,0,80)">rfi-&gt;</span><span style="color:rgb(80,0,80)">remap-&gt;rmnt_id.</span><br></div><div>I&#39;ve overlooked this very small patch. It is part of a bigger patchset. Sorry. Will resend proper version (v2) soon.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
&gt;               }<br>
&gt;<br>
&gt;               mutex_unlock(ghost_file_mutex);<br>
&gt;<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Best regards,<br>Eugene Batalov.</div>
</div></div>