<div dir="ltr">Thank you so much.Soumya,you make me more clear about the logic of the code.<div><br><div>I used to wonder the code was to handle the last resolve case.However i followed</div><div><br></div><div>the &quot;nfs3_fh_resolve_entry_hard&quot; and I thought it would get the ret == -2 case and went</div><div><br></div><div>into the &quot;nfs3_lookup_op&quot; branch,and finally call the &quot;nfs3_call_resume&quot;.Seems has</div><div><br></div><div>no chance to call &quot;nfs3_fh_resolve_entry_lookup_cbk&quot; because it was a LOOKUP</div><div><br></div><div>operation.Am i wrong again? :-)</div><div><br></div><div><br><div class="gmail_extra"><br><div class="gmail_quote">2016-11-16 21:45 GMT+08:00 Soumya Koduri <span dir="ltr">&lt;<a href="mailto:skoduri@redhat.com" target="_blank">skoduri@redhat.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><br>
<br>
On 11/16/2016 06:38 PM, Pranith Kumar Karampuri wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
Added people who know nfs code.<br>
<br>
On Wed, Nov 16, 2016 at 6:21 PM, jin deng &lt;<a href="mailto:cheneydeng88@gmail.com" target="_blank">cheneydeng88@gmail.com</a><br></span><span class="gmail-">
&lt;mailto:<a href="mailto:cheneydeng88@gmail.com" target="_blank">cheneydeng88@gmail.com</a><wbr>&gt;&gt; wrote:<br>
<br>
    Hi all,<br>
        I&#39;m reading the code of 3.6.9 version and got a question.And I&#39;m<br>
    not very familiar with the code,so I have to confirm it(I checked<br>
    the master branch,it&#39;s same with 3.6.9).<br>
<br>
        The question is about the &#39;lookup&#39; operation of NFS.And i&#39;m with<br>
    this code flow:<br>
<br>
        nfs3_lookup (nfs3.c) ==&gt; nfs3_fh_resolve_and_resume<br>
    ==&gt; nfs3_fh_resolve_root ==&gt; nfs3_fh_resolve_resume<br>
    ==&gt; nfs3_fh_resolve_entry ==&gt; nfs3_fh_resolve_entry_hard.<br>
<br>
    Now enter the &quot;nfs_entry_loc_fill&quot; and return with -1 which means<br>
    the &quot;parent&quot; not found,so we have to do hard resolve about the<br>
    parent. After doing a hard resolve,we get into the callback<br>
    &quot;nfs3_fh_resolve_inode_lookup_<wbr>cbk&quot;.And the callback has the<br>
    following code:<br>
<br>
    &gt;&gt;&gt; memcpy (&amp;cs-&gt;stbuf, buf, sizeof(*buf));<br>
    &gt;&gt;&gt; memcpy (&amp;cs-&gt;postparent, buf, sizeof(*postparent))<br>
</span></blockquote>
<br>
This must had been done  (and required) in case if this was the last entry(/inode) to be looked up<span class="gmail-"> <br></span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
    I think we&#39;ve just done a parent resolve,how could we assign the<br>
    parent result into the &quot;stbuf&quot; and &quot;postparent&quot;.The later two should<br>
    be the information of the child file/directory.Do i made a<br>
    misunderstand?<br>
</blockquote>
<br></span>
In case if it was not the last entry we fall through below code in &quot;nfs3_fh_resolve_inode_lookup_<wbr>cbk&quot; -<br>
<br>
        if (cs-&gt;resolventry)<br>
                nfs3_fh_resolve_entry_hard (cs);<br>
<br>
Callback is &quot;nfs3_fh_resolve_entry_lookup_<wbr>cbk()&quot; where in cs-&gt;stbuf and cs-&gt;postparent get overridden with the values corresponding to the child entry.<br>
<br>
Thanks,<br>
Soumya<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
<br>
    Thanks advance for your help.<br>
<br>
    ______________________________<wbr>_________________<br>
    Gluster-users mailing list<br></span>
    <a href="mailto:Gluster-users@gluster.org" target="_blank">Gluster-users@gluster.org</a> &lt;mailto:<a href="mailto:Gluster-users@gluster.org" target="_blank">Gluster-users@gluster.<wbr>org</a>&gt;<br>
    <a href="http://www.gluster.org/mailman/listinfo/gluster-users" rel="noreferrer" target="_blank">http://www.gluster.org/mailman<wbr>/listinfo/gluster-users</a><br>
    &lt;<a href="http://www.gluster.org/mailman/listinfo/gluster-users" rel="noreferrer" target="_blank">http://www.gluster.org/mailma<wbr>n/listinfo/gluster-users</a>&gt;<br>
<br>
<br>
<br><span class="gmail-HOEnZb"><font color="#888888">
<br>
--<br>
Pranith<br>
</font></span></blockquote>
</blockquote></div><br></div></div></div></div>