<br><br><div class="gmail_quote">On Tue, Jan 17, 2012 at 5:13 PM,  <span dir="ltr"><<a href="mailto:tao.peng@emc.com">tao.peng@emc.com</a>></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">> On Jan 12, 2012, at 3:52 AM, Lai Siyao wrote:<br>
><br>
> > No, to add a dentry to hash client needs holding LOOKUP lock, but lustre client unhash (see<br>
> ll_unhash_aliases()) doesn't really remove dentry from hash, but set LUSTRE_DCACHE_INVALID flag. So in<br>
> the race you mentioned, another process may add the dentry but later the lock is canceled soon, so at<br>
> the time of revalidate, it needs to do a real lookup.<br>
><br>
> In fact there's more to it.<br>
> Certain operations like open, for example, don't actually get a lock from server so if there was no<br>
> lock to begin with, we add<br>
> the "known invalid" entry to the hash and immediately mark it as invalid, no later lock cancel needed<br>
> to trigger this.<br>
><br>
> Are you referring to ll_lookup_it_finish() that flag negative dentry DCACHE_LUSTRE_INVALID and hash/unhash it immediately if client doesn'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>
> Normally lustre client doesn'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->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'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>