<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Got it. Thanks.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Tao<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Lai Siyao [mailto:laisiyao@whamcloud.com] <br><b>Sent:</b> Tuesday, January 17, 2012 5:44 PM<br><b>To:</b> Peng, Tao<br><b>Cc:</b> green@whamcloud.com; Lustre-discuss@lists.lustre.org<br><b>Subject:</b> Re: [Lustre-discuss] question about dcache revalidate<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On Tue, Jan 17, 2012 at 5:13 PM, <<a href="mailto:tao.peng@emc.com">tao.peng@emc.com</a>> wrote:<o:p></o:p></p><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>> 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.<o:p></o:p></p></div></div><p class=MsoNormal>I see. mdc_intent_open_pack() only asks for child OPEN and parent UPDATE lock. Thanks very much!<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>No, generally only nfsd-exported lustre client requests child OPEN lock.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Bye,<o:p></o:p></p></div><div><p class=MsoNormal>- Lai<o:p></o:p></p></div></div></div></div></body></html>