lustre-devel-lustre.org archive mirror
 help / color / mirror / Atom feed
* [lustre-devel] Locating FID-in-Dirent.
@ 2021-08-04 16:46 Saisha Kamat via lustre-devel
  2021-08-05  3:19 ` Siyao Lai via lustre-devel
  0 siblings, 1 reply; 3+ messages in thread
From: Saisha Kamat via lustre-devel @ 2021-08-04 16:46 UTC (permalink / raw)
  To: lustre-devel


[-- Attachment #1.1: Type: text/plain, Size: 1048 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1669 bytes --]

[-- Attachment #2: inode.png --]
[-- Type: image/png, Size: 122472 bytes --]

[-- Attachment #3: Type: text/plain, Size: 165 bytes --]

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [lustre-devel] Locating FID-in-Dirent.
  2021-08-04 16:46 [lustre-devel] Locating FID-in-Dirent Saisha Kamat via lustre-devel
@ 2021-08-05  3:19 ` Siyao Lai via lustre-devel
  2021-08-05  7:44   ` Andreas Dilger via lustre-devel
  0 siblings, 1 reply; 3+ messages in thread
From: Siyao Lai via lustre-devel @ 2021-08-05  3:19 UTC (permalink / raw)
  To: Saisha Kamat, lustre-devel


[-- Attachment #1.1: Type: text/plain, Size: 1579 bytes --]

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@lists.lustre.org> on behalf of Saisha Kamat via lustre-devel <lustre-devel@lists.lustre.org>
Reply-To: Saisha Kamat <skamat1@uncc.edu>
Date: Thursday, August 5, 2021 at 10:30 AM
To: "lustre-devel@lists.lustre.org" <lustre-devel@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

[-- Attachment #1.2: Type: text/html, Size: 8327 bytes --]

[-- Attachment #2: Type: text/plain, Size: 165 bytes --]

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [lustre-devel] Locating FID-in-Dirent.
  2021-08-05  3:19 ` Siyao Lai via lustre-devel
@ 2021-08-05  7:44   ` Andreas Dilger via lustre-devel
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Dilger via lustre-devel @ 2021-08-05  7:44 UTC (permalink / raw)
  To: Saisha Kamat; +Cc: lustre-devel


[-- Attachment #1.1: Type: text/plain, Size: 3662 bytes --]

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@lists.lustre.org<mailto:lustre-devel@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@lists.lustre.org<mailto:lustre-devel-bounces@lists.lustre.org>> on behalf of Saisha Kamat via lustre-devel <lustre-devel@lists.lustre.org<mailto:lustre-devel@lists.lustre.org>>
Reply-To: Saisha Kamat <skamat1@uncc.edu<mailto:skamat1@uncc.edu>>
Date: Thursday, August 5, 2021 at 10:30 AM
To: "lustre-devel@lists.lustre.org<mailto:lustre-devel@lists.lustre.org>" <lustre-devel@lists.lustre.org<mailto:lustre-devel@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@lists.lustre.org<mailto:lustre-devel@lists.lustre.org>
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Whamcloud








[-- Attachment #1.2: Type: text/html, Size: 20059 bytes --]

[-- Attachment #2: Type: text/plain, Size: 165 bytes --]

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-05  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 16:46 [lustre-devel] Locating FID-in-Dirent Saisha Kamat via lustre-devel
2021-08-05  3:19 ` Siyao Lai via lustre-devel
2021-08-05  7:44   ` Andreas Dilger via lustre-devel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).