[LU-4228] debugfs swab the FID in LMA as big endian Created: 08/Nov/13  Updated: 15/Nov/13  Resolved: 15/Nov/13

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Di Wang Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 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.



 Comments   
Comment by Andreas Dilger [ 08/Nov/13 ]

http://review.whamcloud.com/8216

Generated at Sat Feb 10 01:40:49 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.