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

lfs setstripe --component-add fails to recognize -c -1 as all targets

Details

    • 3
    • 9223372036854775807

    Description

      Performing a 'lfs setstripe --component-add -E <val> -c -1 <file>' on a file with an existing layout yields a new component that is striped with the default stripe count and not a stripe across all targets. Output below.

      [root@silverrock8:lustre]# lfs setstripe -E 2M -c 1 /p/lglossy/root/dne2/dinatale/testfile13
      [root@silverrock8:lustre]# lfs getstripe /p/lglossy/root/dne2/dinatale/testfile13
      /p/lglossy/root/dne2/dinatale/testfile13
        lcm_layout_gen:  1
        lcm_entry_count: 1
          lcme_id:             1
          lcme_flags:          init
          lcme_extent.e_start: 0
          lcme_extent.e_end:   2097152
            lmm_stripe_count:  1
            lmm_stripe_size:   1048576
            lmm_pattern:       1
            lmm_layout_gen:    0
            lmm_stripe_offset: 1
            lmm_objects:
            - 0: { l_ost_idx: 1, l_fid: [0x100010000:0x53242:0x0] }
      
      [root@silverrock8:lustre]# lfs setstripe --component-add -E 4M -c -1 /p/lglossy/root/dne2/dinatale/testfile13
      [root@silverrock8:lustre]# lfs getstripe /p/lglossy/root/dne2/dinatale/testfile13
      /p/lglossy/root/dne2/dinatale/testfile13
        lcm_layout_gen:  2
        lcm_entry_count: 2
          lcme_id:             1
          lcme_flags:          init
          lcme_extent.e_start: 0
          lcme_extent.e_end:   2097152
            lmm_stripe_count:  1
            lmm_stripe_size:   1048576
            lmm_pattern:       1
            lmm_layout_gen:    0
            lmm_stripe_offset: 1
            lmm_objects:
            - 0: { l_ost_idx: 1, l_fid: [0x100010000:0x53242:0x0] }
      
          lcme_id:             2
          lcme_flags:          0
          lcme_extent.e_start: 2097152
          lcme_extent.e_end:   4194304
            lmm_stripe_count:  1
            lmm_stripe_size:   1048576
            lmm_pattern:       1
            lmm_layout_gen:    65535
            lmm_stripe_offset: -1
      

      In the above output, you'll notice the second component has a lmm_stripe_count of 1, our test file system has 4 OSTs.

      I believe I tracked down the issue to 'lod_declare_layout_add' and how it's setting stripe count for each new component. A similar fix may need to happen to 'lod_striping_from_default' for regular files as well. If the below patch seems adequate, I can open a new patch. I can also update the patch with 'lod_striping_from_default' changes if it seems necessary.

      diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c
      index 34f4f2c..5fe2f72 100644
      --- a/lustre/lod/lod_object.c
      +++ b/lustre/lod/lod_object.c
      @@ -2267,9 +2267,10 @@ static int lod_declare_layout_add(const struct lu_env *env,
                      lod_comp->llc_stripe_offset = v1->lmm_stripe_offset;
       
                      lod_comp->llc_stripenr = v1->lmm_stripe_count;
      -               if (!lod_comp->llc_stripenr ||
      -                   lod_comp->llc_stripenr == (__u16)-1)
      +               if (!lod_comp->llc_stripenr)
                              lod_comp->llc_stripenr = desc->ld_default_stripe_count;
      +               else if (lod_comp->llc_stripenr == (__u16)-1)
      +                       lod_comp->llc_stripenr = desc->ld_tgt_count;
                      lod_comp->llc_stripe_size = v1->lmm_stripe_size;
                      if (!lod_comp->llc_stripe_size)
                              lod_comp->llc_stripe_size =
      
       
      

      Attachments

        Activity

          [LU-10462] lfs setstripe --component-add fails to recognize -c -1 as all targets

          John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/31048/
          Subject: LU-10462 lod: Correct lfs --component-add striping
          Project: fs/lustre-release
          Branch: b2_10
          Current Patch Set:
          Commit: 50021977720a419f6df809ee43cdf687bc9f0877

          gerrit Gerrit Updater added a comment - John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/31048/ Subject: LU-10462 lod: Correct lfs --component-add striping Project: fs/lustre-release Branch: b2_10 Current Patch Set: Commit: 50021977720a419f6df809ee43cdf687bc9f0877

          Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/31048
          Subject: LU-10462 lod: Correct lfs --component-add striping
          Project: fs/lustre-release
          Branch: b2_10
          Current Patch Set: 1
          Commit: 7ecef66cdf67999beb26b680c7bb73fb1c63c52b

          gerrit Gerrit Updater added a comment - Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/31048 Subject: LU-10462 lod: Correct lfs --component-add striping Project: fs/lustre-release Branch: b2_10 Current Patch Set: 1 Commit: 7ecef66cdf67999beb26b680c7bb73fb1c63c52b
          pjones Peter Jones added a comment -

          Landed for 2.11

          pjones Peter Jones added a comment - Landed for 2.11

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30790/
          Subject: LU-10462 lod: Correct lfs --component-add striping
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: b7285d387c78fbd11579c577230593ba1b0be84e

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30790/ Subject: LU-10462 lod: Correct lfs --component-add striping Project: fs/lustre-release Branch: master Current Patch Set: Commit: b7285d387c78fbd11579c577230593ba1b0be84e

          Giuseppe Di Natale (dinatale2@llnl.gov) uploaded a new patch: https://review.whamcloud.com/30790
          Subject: LU-10462 lod: Correct lfs --component-add striping
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: be53389806e9717227a45f9c468936bfb0963511

          gerrit Gerrit Updater added a comment - Giuseppe Di Natale (dinatale2@llnl.gov) uploaded a new patch: https://review.whamcloud.com/30790 Subject: LU-10462 lod: Correct lfs --component-add striping Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: be53389806e9717227a45f9c468936bfb0963511

          Peter, I will post a patch on Monday.

          dinatale2 Giuseppe Di Natale (Inactive) added a comment - - edited Peter, I will post a patch on Monday.
          pjones Peter Jones added a comment -

          So, dinatale2 will you push a patch into Gerrit for this fix or would you prefer that Bobijam handles it?

          pjones Peter Jones added a comment - So, dinatale2 will you push a patch into Gerrit for this fix or would you prefer that Bobijam handles it?
          bobijam Zhenyu Xu added a comment -

          yes, I think the patch is the fix, and lod_striping_from_default() also needs it.

          bobijam Zhenyu Xu added a comment - yes, I think the patch is the fix, and lod_striping_from_default() also needs it.
          pjones Peter Jones added a comment -

          Bobijam

          Can you please look into this one?

          Thanks

          Peter

          pjones Peter Jones added a comment - Bobijam Can you please look into this one? Thanks Peter

          People

            bobijam Zhenyu Xu
            dinatale2 Giuseppe Di Natale (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: