<div dir="ltr">sorry,I read you patch(<span style="color:rgb(80,0,80);font-size:14px"> </span><a href="http://review.gluster.org/14911" rel="noreferrer" target="_blank" style="font-size:14px">http://review.gluster.org/1491<wbr>1</a>),that fix the problem.Thanks very much.</div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-16 22:38 GMT+08:00 jin deng <span dir="ltr"><<a href="mailto:cheneydeng88@gmail.com" target="_blank">cheneydeng88@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">2016-11-16 22:30 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="m_-6626413255818935010gmail-"><br>
<br>
On 11/16/2016 07:38 PM, jin deng wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Thank you so much.Soumya,you make me more clear about the logic of the code.<br>
<br>
I used to wonder the code was to handle the last resolve case.However i<br>
followed<br>
<br>
the "nfs3_fh_resolve_entry_hard" and I thought it would get the ret ==<br>
-2 case and went<br>
<br>
into the "nfs3_lookup_op" branch,and finally call the<br>
"nfs3_call_resume".Seems has<br>
<br>
no chance to call "nfs3_fh_resolve_entry_lookup_<wbr>cbk" because it was a LOOKUP<br>
<br>
operation.Am i wrong again? :-)<br>
</blockquote>
<br></span>
You are right :)...for LOOKUP fop, we go to "nfs3_call_resume" which is nfs3_lookup_resume and the callback is "nfs3svc_lookup_cbk" where in we are not updating cs->stbuf. But we seem to be constructing lookup reply (nfs3_lookup_reply) using 'buf' directly returned for the child entry instead of using cs->stbuf. Maybe that's the reason it was working well till now.<br>
FYI - there was an issue in the lookup logic code path which we fixed as part of <a href="http://review.gluster.org/14911" rel="noreferrer" target="_blank">http://review.gluster.org/1491<wbr>1</a> . I will not be surprised if there are any more lurking around :)<br></blockquote><div> </div></span><div> hmm...seems still has a problem.As the "cs->hardresolved" has been set to 1 in "nfs3_fh_resolve_inode_hard".<wbr>The "nfs3_lookup_resume" callback will not</div><div> get into the "nfs3svc_lookup_cbk".Instead,<wbr>the "nfs3_lookup_resume" will terminate at here as I thought:</div><div><br></div><div><div> if (cs->hardresolved) {</div><div><span class="m_-6626413255818935010gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>stat = NFS3_OK;</div><div><span class="m_-6626413255818935010gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>nfs3_fh_build_child_fh (&cs->parent, &cs->stbuf, &newfh);</div><div><span class="m_-6626413255818935010gmail-Apple-tab-span" style="white-space:pre-wrap">                </span>goto nfs3err;</div><div><span class="m_-6626413255818935010gmail-Apple-tab-span" style="white-space:pre-wrap"> }        </span></div></div><div><span class="m_-6626413255818935010gmail-Apple-tab-span" style="white-space:pre-wrap"><br></span></div><div><span class="m_-6626413255818935010gmail-Apple-tab-span" style="white-space:pre-wrap"> I wonder if this works fine because the NFS client always resolve the parent first, not very sure.</span></div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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="m_-6626413255818935010gmail-">
<br>
<br>
<br>
2016-11-16 21:45 GMT+08:00 Soumya Koduri <<a href="mailto:skoduri@redhat.com" target="_blank">skoduri@redhat.com</a><br></span>
<mailto:<a href="mailto:skoduri@redhat.com" target="_blank">skoduri@redhat.com</a>>>:<span class="m_-6626413255818935010gmail-"><br>
<br>
<br>
<br>
On 11/16/2016 06:38 PM, Pranith Kumar Karampuri wrote:<br>
<br>
Added people who know nfs code.<br>
<br>
On Wed, Nov 16, 2016 at 6:21 PM, jin deng<br>
<<a href="mailto:cheneydeng88@gmail.com" target="_blank">cheneydeng88@gmail.com</a> <mailto:<a href="mailto:cheneydeng88@gmail.com" target="_blank">cheneydeng88@gmail.com</a><wbr>><br></span>
<mailto:<a href="mailto:cheneydeng88@gmail.com" target="_blank">cheneydeng88@gmail.com</a> <mailto:<a href="mailto:cheneydeng88@gmail.com" target="_blank">cheneydeng88@gmail.com</a><wbr>>>><div><div class="m_-6626413255818935010gmail-h5"><br>
wrote:<br>
<br>
Hi all,<br>
I'm reading the code of 3.6.9 version and got a<br>
question.And I'm<br>
not very familiar with the code,so I have to confirm it(I<br>
checked<br>
the master branch,it's same with 3.6.9).<br>
<br>
The question is about the 'lookup' operation of NFS.And<br>
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<br>
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>
<br>
<br>
This must had been done (and required) in case if this was the last<br>
entry(/inode) to be looked up<br>
<br>
<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<br>
two should<br>
be the information of the child file/directory.Do i made a<br>
misunderstand?<br>
<br>
<br>
In case if it was not the last entry we fall through below code in<br>
"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<br>
and cs->postparent get overridden with the values corresponding to<br>
the child entry.<br>
<br>
Thanks,<br>
Soumya<br>
<br>
<br>
Thanks advance for your help.<br>
<br>
______________________________<wbr>_________________<br>
Gluster-users mailing list<br>
<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></div></div>
<mailto:<a href="mailto:Gluster-users@gluster.org" target="_blank">Gluster-users@gluster.<wbr>org</a><span class="m_-6626413255818935010gmail-"><br>
<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>
<<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>
<<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>
<br>
--<br>
Pranith<br>
<br>
<br>
</span></blockquote>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>