<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 "nfs3_fh_resolve_entry_hard" and I thought it would get the ret == -2 case and went</div><div><br></div><div>into the "nfs3_lookup_op" branch,and finally call the "nfs3_call_resume".Seems has</div><div><br></div><div>no chance to call "nfs3_fh_resolve_entry_lookup_cbk" 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"><<a href="mailto:skoduri@redhat.com" target="_blank">skoduri@redhat.com</a>></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 <<a href="mailto:cheneydeng88@gmail.com" target="_blank">cheneydeng88@gmail.com</a><br></span><span class="gmail-">
<mailto:<a href="mailto:cheneydeng88@gmail.com" target="_blank">cheneydeng88@gmail.com</a><wbr>>> wrote:<br>
<br>
Hi all,<br>
I'm reading the code of 3.6.9 version and got a question.And I'm<br>
not very familiar with the code,so I have to confirm it(I checked<br>
the master branch,it's same with 3.6.9).<br>
<br>
The question is about the 'lookup' operation of NFS.And i'm with<br>
this code flow:<br>
<br>
nfs3_lookup (nfs3.c) ==> nfs3_fh_resolve_and_resume<br>
==> nfs3_fh_resolve_root ==> nfs3_fh_resolve_resume<br>
==> nfs3_fh_resolve_entry ==> nfs3_fh_resolve_entry_hard.<br>
<br>
Now enter the "nfs_entry_loc_fill" and return with -1 which means<br>
the "parent" not found,so we have to do hard resolve about the<br>
parent. After doing a hard resolve,we get into the callback<br>
"nfs3_fh_resolve_inode_lookup_<wbr>cbk".And the callback has the<br>
following code:<br>
<br>
>>> memcpy (&cs->stbuf, buf, sizeof(*buf));<br>
>>> memcpy (&cs->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've just done a parent resolve,how could we assign the<br>
parent result into the "stbuf" and "postparent".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 "nfs3_fh_resolve_inode_lookup_<wbr>cbk" -<br>
<br>
if (cs->resolventry)<br>
nfs3_fh_resolve_entry_hard (cs);<br>
<br>
Callback is "nfs3_fh_resolve_entry_lookup_<wbr>cbk()" where in cs->stbuf and cs->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> <mailto:<a href="mailto:Gluster-users@gluster.org" target="_blank">Gluster-users@gluster.<wbr>org</a>><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>
<<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>><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>