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

growing a PFL file with last stripe as -1 fails

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Lustre 2.14.0, Lustre 2.12.5
    • Lustre 2.10.8
    • None
    • 2
    • 9223372036854775807

    Description

      If a file/dir is striped with last stripe count set to -1 growing the file fails.

      $  lfs setstripe -E 256M -c 1 -E 16G -c 4 -E -1 -S 4M -c -1 pfldir
      $  echo hello > pfldir/test
      $ echo helpo >> pfldir/test 
      -bash: echo: write error: No space left on device
      
      $  lfs getstripe pfldir/test
      pfldir/test
        lcm_layout_gen:    3
        lcm_mirror_count:  1
        lcm_entry_count:   3
          lcme_id:             1
          lcme_mirror_id:      0
          lcme_flags:          init
          lcme_extent.e_start: 0
          lcme_extent.e_end:   268435456
            lmm_stripe_count:  1
            lmm_stripe_size:   1048576
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: 313
            lmm_objects:
            - 0: { l_ost_idx: 313, l_fid: [0x101390000:0x110967ab:0x0] }
      
          lcme_id:             2
          lcme_mirror_id:      0
          lcme_flags:          0
          lcme_extent.e_start: 268435456
          lcme_extent.e_end:   17179869184
            lmm_stripe_count:  4
            lmm_stripe_size:   1048576
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: -1
      
          lcme_id:             3
          lcme_mirror_id:      0
          lcme_flags:          0
          lcme_extent.e_start: 17179869184
          lcme_extent.e_end:   EOF
            lmm_stripe_count:  -1
            lmm_stripe_size:   4194304
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: -1
      
      $  lfs setstripe -E 256M -c 1 -E 16G -c 4 -E -1 -S 4M -c 10 pfldir
      $  echo hello > pfldir/test
      $  echo helpo >> pfldir/test 
      
      This worked.
      

      Attachments

        1. mdt.debug.gz
          147.23 MB
        2. mdt.pid.34027.out.gz
          167 kB
        3. r417i2n16.debug2.out.gz
          36 kB
        4. r417i2n16.out
          276 kB

        Activity

          [LU-12852] growing a PFL file with last stripe as -1 fails

          Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37512/
          Subject: LU-12852 pfl: restrict the stripe count correctly
          Project: fs/lustre-release
          Branch: b2_12
          Current Patch Set:
          Commit: 454771e39c556ac5a4b290d2bbf603dc7f308fdf

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/37512/ Subject: LU-12852 pfl: restrict the stripe count correctly Project: fs/lustre-release Branch: b2_12 Current Patch Set: Commit: 454771e39c556ac5a4b290d2bbf603dc7f308fdf

          Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/37512
          Subject: LU-12852 pfl: restrict the stripe count correctly
          Project: fs/lustre-release
          Branch: b2_12
          Current Patch Set: 1
          Commit: 6a95331bcb4d4f0dd9c7c8a152509e1a6652042c

          gerrit Gerrit Updater added a comment - Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/37512 Subject: LU-12852 pfl: restrict the stripe count correctly Project: fs/lustre-release Branch: b2_12 Current Patch Set: 1 Commit: 6a95331bcb4d4f0dd9c7c8a152509e1a6652042c
          pjones Peter Jones added a comment -

          Landed for 2.14

          pjones Peter Jones added a comment - Landed for 2.14

          Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36947/
          Subject: LU-12852 pfl: restrict the stripe count correctly
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 6dc37759cfb22727ac5d776c38b72e8638563fd8

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36947/ Subject: LU-12852 pfl: restrict the stripe count correctly Project: fs/lustre-release Branch: master Current Patch Set: Commit: 6dc37759cfb22727ac5d776c38b72e8638563fd8

          Emoly Liu (emoly@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36947
          Subject: LU-12852 pfl: restrict the stripe count correctly
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 8ab6646313ba7c7391ed19bd705ca5e694b5823d

          gerrit Gerrit Updater added a comment - Emoly Liu (emoly@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36947 Subject: LU-12852 pfl: restrict the stripe count correctly Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 8ab6646313ba7c7391ed19bd705ca5e694b5823d
          pjones Peter Jones added a comment -

          Could you please create a patch to address this issue?

          pjones Peter Jones added a comment - Could you please create a patch to address this issue?

          It looks like there is already a function "lod_get_stripe_count()" that is supposed to be checking the maximum xattr size and restricting the stripe count to this limit. It may be that the calculation is slightly incorrect (e.g. not taking into account the xattr overhead), so changing this slightly would work:

          -        max_stripes = lov_mds_md_max_stripe_count(easize, LOV_MAGIC_V3);
          +        max_stripes = lov_mds_md_max_stripe_count(easize, LOV_MAGIC_V3) - 1;
          

          but I haven't tested this yet.

          adilger Andreas Dilger added a comment - It looks like there is already a function " lod_get_stripe_count() " that is supposed to be checking the maximum xattr size and restricting the stripe count to this limit. It may be that the calculation is slightly incorrect (e.g. not taking into account the xattr overhead), so changing this slightly would work: - max_stripes = lov_mds_md_max_stripe_count(easize, LOV_MAGIC_V3); + max_stripes = lov_mds_md_max_stripe_count(easize, LOV_MAGIC_V3) - 1; but I haven't tested this yet.

          "correct number of stripes" meaning what ever it can fit.  Like the non-PFL case. It shouldn't fail.

           

          mhanafi Mahmoud Hanafi added a comment - "correct number of stripes" meaning what ever it can fit.  Like the non-PFL case. It shouldn't fail.  

          Mahmoud, could you clarify what you mean by "correct number of stripes" in this case? Without the "ea_inode" feature, then PFL will just not have as much space to store stripes as a non-PFL file. Hopefully by "correct number of stripes" you mean "whatever will still fit into the remaining xattr space", which is probably about 150 in your case, but will vary based on the number and size of the previous components. If you enable the "ea_inode" feature then you would actually be able to store the full 342 stripes in the last component.

          adilger Andreas Dilger added a comment - Mahmoud, could you clarify what you mean by "correct number of stripes" in this case? Without the " ea_inode " feature, then PFL will just not have as much space to store stripes as a non-PFL file. Hopefully by "correct number of stripes" you mean "whatever will still fit into the remaining xattr space", which is probably about 150 in your case, but will vary based on the number and size of the previous components. If you enable the " ea_inode " feature then you would actually be able to store the full 342 stripes in the last component.

          I think this is a bug. PFL should create the correct number of stripes as with the non-PFL file. 

          mhanafi Mahmoud Hanafi added a comment - I think this is a bug. PFL should create the correct number of stripes as with the non-PFL file. 

          People

            emoly.liu Emoly Liu
            mhanafi Mahmoud Hanafi
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: