[lustre-devel] Locating FID-in-Dirent.
Andreas Dilger
adilger at whamcloud.com
Thu Aug 5 00:44:44 PDT 2021
You can also see this with debugfs, using the "ls -lD <dir>" option. This will dump the FID-in-dirent data, if present:
debugfs -c -R "ls -lD ROOT" /dev/loop0
debugfs 1.46.2.wc1 (28-Feb-2021)
/dev/loop0: catastrophic mode - not reading inode or group bitmaps
25043 40755 (2) 0 0 4096 4-Aug-2021 03:20 .
2 40755 (2) 0 0 4096 27-Jul-2021 12:14 ..
25044 40755 (18) 0 0 4096 27-Jul-2021 12:14 fid:[0x200000002:0x1:0x0] .lustre
188 100644 (17) 0 0 0 27-Jul-2021 12:21 fid:[0x200000402:0x1:0x0] foo
189 100644 (17) 0 0 0 27-Jul-2021 12:22 fid:[0x200000402:0x2:0x0] bar
190 100644 (17) 0 0 0 29-Jul-2021 00:23 fid:[0x200000402:0x3:0x0] data
25070 40755 (18) 0 0 4096 3-Aug-2021 13:49 fid:[0x2000013a1:0x2:0x0] pfl
195 100644 (17) 0 0 28128 2-Aug-2021 14:46 fid:[0x2000013a1:0x9:0x0] fsxfile
196 100644 (17) 0 0 0 2-Aug-2021 02:17 fid:[0x2000013a1:0xa:0x0] fsxfile.fsxgood
197 100644 (17) 0 0 0 2-Aug-2021 14:46 fid:[0x2000013a1:0xb:0x0] fsxfile.fsxlog
198 100644 (17) 0 0 0 3-Aug-2021 12:59 fid:[0x2000013a1:0xc:0x0] nolayout
199 100644 (17) 0 0 0 3-Aug-2021 13:00 fid:[0x2000013a1:0xe:0x0] nolayout2
201 100644 (17) 0 0 0 3-Aug-2021 20:36 fid:[0x2000013a1:0x13:0x0] data.3d70119
On Aug 4, 2021, at 21:19, Siyao Lai via lustre-devel <lustre-devel at lists.lustre.org<mailto:lustre-devel at lists.lustre.org>> wrote:
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<mailto:lustre-devel-bounces at lists.lustre.org>> on behalf of Saisha Kamat via lustre-devel <lustre-devel at lists.lustre.org<mailto:lustre-devel at lists.lustre.org>>
Reply-To: Saisha Kamat <skamat1 at uncc.edu<mailto:skamat1 at uncc.edu>>
Date: Thursday, August 5, 2021 at 10:30 AM
To: "lustre-devel at lists.lustre.org<mailto:lustre-devel at lists.lustre.org>" <lustre-devel at lists.lustre.org<mailto: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
_______________________________________________
lustre-devel mailing list
lustre-devel at lists.lustre.org<mailto:lustre-devel at lists.lustre.org>
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Whamcloud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20210805/c1739069/attachment-0001.html>
More information about the lustre-devel
mailing list