Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-838

"lfs path2fid /mnt/lustre" (ROOT) returns inode number

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • None
    • Lustre 2.4.0
    • 3
    • 3991

      Running "lfs path2fid" on the Lustre mountpoint (e.g. /mnt/lustre) will return the underlying "ROOT/" directory inode number. This is bad for a number of reasons:

      • it exposes the on-disk inode number to userspace as an IGIF value
      • this will be broken after a backup/restore cycle
      • this value is stored in the "link" xattr of all files in the ROOT/ directory

      $ lfs path2fid /mnt/lustre
      [0x61ab:0x6cad245e:0x0]

      $ getfattr -d -m trusted.link -e hex /mnt/lustre/etc
      getfattr: Removing leading '/' from absolute path names

      1. file: mnt/lustre/etc
        trusted.link=0xdff1ea11010000002d000000000000000000000000000000001500000000000061ab6cad245e00000000657463

      This should probably be fixed by moving MDD_ROOT_INDEX_OID to be 1UL or 2UL, and then returning FID_SEQ_START:MDD_ROOT_INDEX_OID to the client, like:

      $ lfs path2fid /mnt/lustre
      [0x200000000:0x2:0x0]

      All that is needed is to ensure that the ROOT/ inode stores this in the LMA. This has the drawback that FID_SEQ_START is not currently exposed to clients and it fixes MDD_ROOT_INDEX_OID to a specific value (since it will be stored in the "link" xattr).

      The alternative is to expose some other SEQ:OID for the root FID.

            tappro Mikhail Pershin
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: