[LU-16831] "lfs setstripe" should limit stripe count for component size Created: 15/May/23  Updated: 23/Jan/24  Resolved: 20/Jul/23

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

Type: Improvement Priority: Minor
Reporter: Andreas Dilger Assignee: Zhenyu Xu
Resolution: Fixed Votes: 0
Labels: easy

Issue Links:
Related
is related to LU-14554 Improve usability of "lfs mirror" com... Open
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

It appears that if "lfs setstripe" requests a stripe count that is larger than component_size / stripe_size then the requested number of OST objects will be created, but the ones at the end of the component will be inaccessible.

For example, creating a 1MiB component with 4x 1MiB stripes will create 3 OST objects that cannot be used:

# lfs setstripe -E 1M -c 4 -E eof -c 4 /mnt/testfs/badstripe
# lfs getstripe /mnt/testfs/badstripe
  lcm_entry_count:   2
    lcme_id:             1
    lcme_flags:          init
    lcme_extent.e_start: 0
    lcme_extent.e_end:   1048576
      lmm_stripe_count:  4
      lmm_stripe_size:   1048576
      lmm_stripe_offset: 1
      lmm_objects:
      - 0: { l_ost_idx: 1, l_fid: [0x340000403:0x163:0x0] }
      - 1: { l_ost_idx: 2, l_fid: [0x380000403:0x163:0x0] }
      - 2: { l_ost_idx: 3, l_fid: [0x3c0000403:0x1cd:0x0] }
      - 3: { l_ost_idx: 0, l_fid: [0x300000403:0x1a3:0x0] }

    lcme_id:             2
    lcme_flags:          0
    lcme_extent.e_start: 1048576
    lcme_extent.e_end:   EOF
      lmm_stripe_count:  4
      lmm_stripe_size:   1048576
      lmm_stripe_offset: -1

In this case, the MDS should limit the stripe count to:

        stripe_count = min(requested_stripe_count, (comp_end - comp_start) / stripe_size);


 Comments   
Comment by Gerrit Updater [ 26/May/23 ]

"Zhenyu Xu <bobijam@hotmail.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51143
Subject: LU-16831 lfs: limit stripe count for component size
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 1a3ff99eba507e85219caa33b8907d21dd193d81

Comment by Gerrit Updater [ 19/Jul/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51143/
Subject: LU-16831 lfs: limit stripe count for component size
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: a250ecb959a98c2ec0a01bbca9d943a19b8fa078

Comment by Andreas Dilger [ 20/Jul/23 ]

landed for 2.16.0

Comment by Gerrit Updater [ 11/Aug/23 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51930
Subject: LU-16831 tests: add version check to sanity-pfl/0e
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 5c10bd215ac0c0ce8351795215067071387bfc5b

Comment by Gerrit Updater [ 23/Aug/23 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/52055
Subject: LU-16831 lod: replace (__u16)-1 with LOV_ALL_STRIPES
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 29dfab22de08c18b04a6a0fe928d9b1e40d2b7f3

Comment by Gerrit Updater [ 24/Aug/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51930/
Subject: LU-16831 tests: add version check to sanity-pfl/0e
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 95cfad833af10f4a8880834b0f3dfd2c7349b70b

Comment by Gerrit Updater [ 06/Sep/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52055/
Subject: LU-16831 lod: replace (__u16)-1 with LOV_ALL_STRIPES
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: cde84a9a24bbca12427bc51495d2fba0778b9e33

Comment by Gerrit Updater [ 23/Jan/24 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/53775
Subject: LU-16831 lfs: limit stripe count for component size
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: 775a8749c5a8726099a59cd35e7d96f70a53f80e

Generated at Sat Feb 10 03:30:22 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.