<br><br><div class="gmail_quote">On Tue, Jan 17, 2012 at 5:13 PM,  <span dir="ltr">&lt;<a href="mailto:tao.peng@emc.com">tao.peng@emc.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">&gt; On Jan 12, 2012, at 3:52 AM, Lai Siyao wrote:<br>
&gt;<br>
&gt; &gt; No, to add a dentry to hash client needs holding LOOKUP lock, but lustre client unhash (see<br>
&gt; ll_unhash_aliases()) doesn&#39;t really remove dentry from hash, but set LUSTRE_DCACHE_INVALID flag. So in<br>
&gt; the race you mentioned, another process may add the dentry but later the lock is canceled soon, so at<br>
&gt; the time of revalidate, it needs to do a real lookup.<br>
&gt;<br>
&gt; In fact there&#39;s more to it.<br>
&gt; Certain operations like open, for example, don&#39;t actually get a lock from server so if there was no<br>
&gt; lock to begin with, we add<br>
&gt; the &quot;known invalid&quot; entry to the hash and immediately mark it as invalid, no later lock cancel needed<br>
&gt; to trigger this.<br>
&gt;<br>
&gt; Are you referring to ll_lookup_it_finish() that flag negative dentry DCACHE_LUSTRE_INVALID and hash/unhash it immediately if client doesn&#39;t have UDATE lock? Looks like such dentry is skipped during link path walk as ll_dcompare checks DCACHE_LUSTRE_INVALID. Or am I looking at wrong place?<br>

<br>
&gt; Normally lustre client doesn&#39;t fetch any child lock for lookup(IT_OPEN), but a child dentry will be inserted into hash, however this dentry is marked INVALID, and it will be freed after file-&gt;release(), that means, no other processes will use the dentry (in this case other processes will create another dentry for this file and add to hash too). So Oleg means a dentry may be inserted into hash without LOOKUP lock, but this dentry won&#39;t be used by others, so it will not cause the race you mentioned.<br>

<br>
</div></div>I see. mdc_intent_open_pack() only asks for child OPEN and parent UPDATE lock. Thanks very much!<br></blockquote><div><br></div><div>No, generally only nfsd-exported lustre client requests child OPEN lock.</div>
<div><br></div><div>Bye,</div><div>- Lai</div></div>