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

debugfs swab the FID in LMA as big endian

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • None
    • None
    • 3
    • 11518

    Description

      In e2fsprog 1.42.7wc1, debugfs show fid as

      static void print_lmastr(FILE *out, ext2_ino_t inode_num, void *data, int len)
      {
              struct lustre_mdt_attrs *lma = data;
      
              if (len < offsetof(typeof(*lma), lma_self_fid) +
                        sizeof(lma->lma_self_fid)) {
                      fprintf(stderr, "%s: error: LMA for inode %u smaller than "
                              "expected (%d bytes).\n",
                              debug_prog_name, inode_num, len);
                      return;
              }
              fid_be_to_cpu(&lma->lma_self_fid, &lma->lma_self_fid);
              fprintf(out, "  lma: fid="DFID" compat=%x incompat=%x\n",
                      PFID(&lma->lma_self_fid), ext2fs_le32_to_cpu(lma->lma_compat),
                      ext2fs_le32_to_cpu(lma->lma_incompat));
      }
      

      It is wrong, since fid in LMA is stored as little endian.

      Attachments

        Activity

          People

            wc-triage WC Triage
            di.wang Di Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: