[lustre-devel] Locating FID-in-Dirent.

Siyao Lai slai at ddn.com
Wed Aug 4 20:19:27 PDT 2021


FID is packed after ext4_dir_entry.name, you can refer to osd_ldiskfs_filldir() to see how it’s unpacked.

Cheers,
Lai

From: lustre-devel <lustre-devel-bounces at lists.lustre.org> on behalf of Saisha Kamat via lustre-devel <lustre-devel at lists.lustre.org>
Reply-To: Saisha Kamat <skamat1 at uncc.edu>
Date: Thursday, August 5, 2021 at 10:30 AM
To: "lustre-devel at lists.lustre.org" <lustre-devel at lists.lustre.org>
Subject: [lustre-devel] Locating FID-in-Dirent.


Hi all,



I am a Ph.D student at UNCC. I am currently trying to retrieve lustre metadata from ldiskfs.



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.



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).



struct ext4_dir_entry {

    __le32    inode;            /* Inode number */

    __le16    rec_len;        /* Directory entry length */

    __le16    name_len;        /* Name length */

    char    name[EXT4_NAME_LEN];    /* File name */

};




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.



Can you let us know where to locate the FID-in-Dirent information?



Thanks,
Saisha Kamat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20210805/c1ee4c86/attachment.html>


More information about the lustre-devel mailing list