<html 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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Monaco;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        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:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">FID is packed after ext4_dir_entry.name, you can refer to osd_ldiskfs_filldir() to see how it’s unpacked.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
<p class="MsoNormal">Lai<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">lustre-devel <lustre-devel-bounces@lists.lustre.org> on behalf of Saisha Kamat via lustre-devel <lustre-devel@lists.lustre.org><br>
<b>Reply-To: </b>Saisha Kamat <skamat1@uncc.edu><br>
<b>Date: </b>Thursday, August 5, 2021 at 10:30 AM<br>
<b>To: </b>"lustre-devel@lists.lustre.org" <lustre-devel@lists.lustre.org><br>
<b>Subject: </b>[lustre-devel] Locating FID-in-Dirent.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm;box-sizing:inherit;font-variant-ligatures:none;white-space:pre-wrap;border-radius:4px;font-variant-caps:normal;text-decoration-style:initial;text-decoration-color:initial;word-spacing:0px"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">Hi all, <o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D"><o:p> </o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">I am a Ph.D student at UNCC. I am currently trying to retrieve lustre metadata from ldiskfs. <o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D"><o:p> </o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">The Lustre Document for LFSCK Phase 1.5 suggests that there is a FID-in-Dirent (File Identifier for each sub-directories and child files) stored in the Directory Entry of the Parent Directory. But we could not find such FID while reading the directory entry of ldiskfs.<o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D"><o:p> </o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">We use the following data struct ext4_dir_entry{} to access the directory entry information (after checking the ldiskfs patches, we do not notice any change to this data structure in ldiskfs).<o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D"><o:p> </o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">struct ext4_dir_entry {<o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">    __le32    inode;            /* Inode number */<o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">    __le16    rec_len;        /* Directory entry length */<o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">    __le16    name_len;        /* Name length */<o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">    char    name[EXT4_NAME_LEN];    /* File name */<o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">};  <o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D"> <br><br><o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">Applying it to a ldiskfs image, we are able to read each directory entry's inode number and name correctly. But, we can not find its File Identifier.<o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D"> <o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">Can you let us know where to locate the FID-in-Dirent information?<o:p></o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D"><o:p> </o:p></span></pre>
<pre style="mso-margin-top-alt:3.0pt;margin-right:0cm;margin-bottom:3.0pt;margin-left:0cm"><span style="font-size:9.0pt;font-family:Monaco;color:#1D1C1D">Thanks,<br>Saisha Kamat<o:p></o:p></span></pre>
</div>
</div>
</body>
</html>