[LU-5343] double swab of stripe count in lmv_unpack_md_v1() Created: 14/Jul/14  Updated: 15/Jul/14  Resolved: 15/Jul/14

Status: Closed
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.6.0, Lustre 2.7.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: WC Triage
Resolution: Duplicate Votes: 0
Labels: dne2, ppc

Severity: 3
Rank (Obsolete): 14902

 Description   

In lmv_unpack_md_v1() we convert stripe count from little endian to CPU endian twice. This is a problem on big endian:

        stripe_count = le32_to_cpu(lmm1->lmv_stripe_count);
        for (i = 0; i < le32_to_cpu(stripe_count); i++) {

Trying to ls a striped directory from a PPC client:

LustreError: 5952:0:(lmv_fld.c:72:lmv_fld_lookup()) ASSERTION( (fid_seq_in_fldb(fid_seq(fid)) || fid_seq_is_local_file(fid_seq(fid))) && fid_is_sane(fid) ) failed: [0x0:0x0:0x0] is insane!
LustreError: 5952:0:(lmv_fld.c:72:lmv_fld_lookup()) LBUG
Kernel panic - not syncing: LBUG
Call Trace:
[c000000799e12d10] [c000000000012ef4] .show_stack+0x74/0x1c0 (unreliable)
[c000000799e12dc0] [c0000000005e5920] .panic+0xc4/0x1f8
[c000000799e12e50] [d0000000063e14c0] .lbug_with_loc+0xb0/0xc0 [libcfs]
[c000000799e12ee0] [d00000000a140eb0] .lmv_fld_lookup+0x260/0x620 [lmv]
[c000000799e12fb0] [d00000000a122c20] .lmv_unpack_md+0x720/0x1530 [lmv]
[c000000799e130d0] [d00000000a5154e0] .mdc_get_lustre_md+0x750/0x2690 [mdc]
[c000000799e131e0] [d00000000a111238] .lmv_get_lustre_md+0xe8/0x590 [lmv]
[c000000799e132c0] [d00000000ca1960c] .ll_prep_inode+0x17c/0x15d0 [lustre]
[c000000799e13420] [d00000000ca3dce8] .ll_lookup_it_finish+0x418/0x1bb0 [lustre]
[c000000799e13570] [d00000000ca3f8f8] .ll_lookup_it+0x478/0xf00 [lustre]
[c000000799e136c0] [d00000000ca40464] .ll_lookup_nd+0xe4/0x7f0 [lustre]
[c000000799e137b0] [c0000000001d7924] .do_lookup+0x254/0x2d0
[c000000799e13880] [c0000000001db5fc] .__link_path_walk+0x9dc/0x1610
[c000000799e139e0] [c0000000001dc5f8] .path_walk+0x98/0x180
[c000000799e13a80] [c0000000001dc91c] .filename_lookup+0x8c/0x100
[c000000799e13b20] [c0000000001dda90] .user_path_at+0x60/0xb0
[c000000799e13c70] [c0000000001cfe34] .vfs_fstatat+0x64/0x110
[c000000799e13d30] [c0000000001d0114] .SyS_newstat+0x24/0x50
[c000000799e13e30] [c000000000008564] syscall_exit+0x0/0x40


 Comments   
Comment by John Hammond [ 14/Jul/14 ]

Also in the handler for LL_IOC_LMV_GETSTRIPE we have unswabbed accesses to the stripe FIDs:

                for (i = 0; i < stripe_count; i++) {
                        struct lu_fid   *fid;

                        fid = &lmm->lmv_md_v1.lmv_stripe_fids[i];
                        mdt_index = ll_get_mdt_idx_by_fid(sbi, fid);
                        if (mdt_index < 0)
                                GOTO(out_tmp, rc = mdt_index);

                        tmp->lum_objects[i].lum_mds = mdt_index;
                        tmp->lum_objects[i].lum_fid = *fid;
                        tmp->lum_stripe_count++;
                }
Comment by John Hammond [ 15/Jul/14 ]

Fixes rolled into patch for LU-5342.

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