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

lfs setstripe --stripe-count 0 --stripe-size 0 cannot change the pfl file/dir to use default attribute

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      I am not sure if this is a problem or suppose to work this way, but I found if use
      "lfs setstripe --stripe-count 0" or "--stripe-size 0" won't change the PFL layout to default stripe count or size, but the --stripe-index 0 can do.

      This related to the sanity 204a/204e failure in LU-16904 patch:
      https://testing.whamcloud.com/test_sets/dc893d55-0536-47b7-a21d-5e88d8fd584f

      [root@trevis-88vm4 lustre]# mkdir tdir
      [root@trevis-88vm4 lustre]# lfs getstripe tdir/
      tdir/
        lcm_layout_gen:    0
        lcm_mirror_count:  1
        lcm_entry_count:   2
          lcme_id:             N/A
          lcme_mirror_id:      N/A
          lcme_flags:          0
          lcme_extent.e_start: 0
          lcme_extent.e_end:   65536
            stripe_count:  1       stripe_size:   4194304       pattern:       raid0       stripe_offset: -1
      
          lcme_id:             N/A
          lcme_mirror_id:      N/A
          lcme_flags:          0
          lcme_extent.e_start: 65536
          lcme_extent.e_end:   EOF
            stripe_count:  2       stripe_size:   1048576       pattern:       raid0       stripe_offset: -1
      
      [root@trevis-88vm4 lustre]# lfs setstripe --stripe-size 0 /mnt/lustre/tdir/
      [root@trevis-88vm4 lustre]# lfs getstripe tdir/
      tdir/
        lcm_layout_gen:    0
        lcm_mirror_count:  1
        lcm_entry_count:   2
          lcme_id:             N/A
          lcme_mirror_id:      N/A
          lcme_flags:          0
          lcme_extent.e_start: 0
          lcme_extent.e_end:   65536
            stripe_count:  1       stripe_size:   4194304       pattern:       raid0       stripe_offset: -1
      
          lcme_id:             N/A
          lcme_mirror_id:      N/A
          lcme_flags:          0
          lcme_extent.e_start: 65536
          lcme_extent.e_end:   EOF
            stripe_count:  2       stripe_size:   1048576       pattern:       raid0       stripe_offset: -1
      
      [root@trevis-88vm4 lustre]# lfs setstripe --stripe-count 0 /mnt/lustre/tdir/
      [root@trevis-88vm4 lustre]# lfs getstripe tdir/
      tdir/
        lcm_layout_gen:    0
        lcm_mirror_count:  1
        lcm_entry_count:   2
          lcme_id:             N/A
          lcme_mirror_id:      N/A
          lcme_flags:          0
          lcme_extent.e_start: 0
          lcme_extent.e_end:   65536
            stripe_count:  1       stripe_size:   4194304       pattern:       raid0       stripe_offset: -1
      
          lcme_id:             N/A
          lcme_mirror_id:      N/A
          lcme_flags:          0
          lcme_extent.e_start: 65536
          lcme_extent.e_end:   EOF
            stripe_count:  2       stripe_size:   1048576       pattern:       raid0       stripe_offset: -1
      
      [root@trevis-88vm4 lustre]# lfs setstripe --stripe-index 0 /mnt/lustre/tdir/
      [root@trevis-88vm4 lustre]# lfs getstripe tdir/
      tdir/
      stripe_count:  1 stripe_size:   4194304 pattern:       raid0 stripe_offset: 0
      
      [root@trevis-88vm4 lustre]# 
      [root@trevis-88vm4 lustre]# lctl get_param -n lov.lustre-clilov-\*.stripesize
      4194304
      [root@trevis-88vm4 lustre]# lctl get_param -n lov.lustre-clilov-\*.stripecount
      1
      
      

      Attachments

        Issue Links

          Activity

            [LU-17655] lfs setstripe --stripe-count 0 --stripe-size 0 cannot change the pfl file/dir to use default attribute
            sarah Sarah Liu added a comment - - edited

            What I found is, the PFL set to root of fs and subdir behave differently here

            If the PFL layout is set to the fs root(/mnt/lustre), --stripe-count 0 and --stripe-size 0 will not change the subdir to use default stripe-count(1) and size(1M) as describe in the ticket.

            [root@trevis-90vm2 lustre]# lfs setstripe -E 64k -c 1 -E eof -c 2 /mnt/lustre/
            [root@trevis-90vm2 lustre]# lfs getstripe /mnt/lustre/
            /mnt/lustre/
              lcm_layout_gen:    0
              lcm_mirror_count:  1
              lcm_entry_count:   2
                lcme_id:             N/A
                lcme_mirror_id:      N/A
                lcme_flags:          0
                lcme_extent.e_start: 0
                lcme_extent.e_end:   65536
                  stripe_count:  1       stripe_size:   1048576       pattern:       raid0       stripe_offset: -1
            
                lcme_id:             N/A
                lcme_mirror_id:      N/A
                lcme_flags:          0
                lcme_extent.e_start: 65536
                lcme_extent.e_end:   EOF
                  stripe_count:  2       stripe_size:   1048576       pattern:       raid0       stripe_offset: -1
            
            [root@trevis-90vm2 lustre]# mkdir subdir
            [root@trevis-90vm2 lustre]# lfs setstripe --stripe-count 0 subdir		  
            [root@trevis-90vm2 lustre]# lfs getstripe --stripe-count subdir
            2
            

            But if the root fs has no PFL, but subdir has PFL layout, the dir created under subdir will do what --stripe-count 0 and --stripe-size 0 suppose to do as describe in the git log

            [root@trevis-90vm2 lustre]# lfs getstripe /mnt/lustre/
            /mnt/lustre/
            stripe_count:  1 stripe_size:   1048576 pattern:       0 stripe_offset: -1
            
            [root@trevis-90vm2 lustre]# mkdir subdir2
            [root@trevis-90vm2 lustre]# lfs setstripe -E 64k -c 1 -E eof -c 2 /mnt/lustre/subdir2/
            [root@trevis-90vm2 lustre]# lfs getstripe subdir2/
            subdir2/
              lcm_layout_gen:    0
              lcm_mirror_count:  1
              lcm_entry_count:   2
                lcme_id:             N/A
                lcme_mirror_id:      N/A
                lcme_flags:          0
                lcme_extent.e_start: 0
                lcme_extent.e_end:   65536
                  stripe_count:  1       stripe_size:   1048576       pattern:       raid0       stripe_offset: -1
            
                lcme_id:             N/A
                lcme_mirror_id:      N/A
                lcme_flags:          0
                lcme_extent.e_start: 65536
                lcme_extent.e_end:   EOF
                  stripe_count:  2       stripe_size:   1048576       pattern:       raid0       stripe_offset: -1
            
            [root@trevis-90vm2 lustre]# mkdir /mnt/lustre/subdir2/tdir2
            [root@trevis-90vm2 lustre]# lfs getstripe --stripe-count /mnt/lustre/subdir2/tdir2/
            2
            
            [root@trevis-90vm2 lustre]# lfs setstripe --stripe-count 0 subdir2/tdir2/
            [root@trevis-90vm2 lustre]# lfs getstripe --stripe-count /mnt/lustre/subdir2/tdir2/
            1
            
            
            sarah Sarah Liu added a comment - - edited What I found is, the PFL set to root of fs and subdir behave differently here If the PFL layout is set to the fs root(/mnt/lustre), --stripe-count 0 and --stripe-size 0 will not change the subdir to use default stripe-count(1) and size(1M) as describe in the ticket. [root@trevis-90vm2 lustre]# lfs setstripe -E 64k -c 1 -E eof -c 2 /mnt/lustre/ [root@trevis-90vm2 lustre]# lfs getstripe /mnt/lustre/ /mnt/lustre/ lcm_layout_gen: 0 lcm_mirror_count: 1 lcm_entry_count: 2 lcme_id: N/A lcme_mirror_id: N/A lcme_flags: 0 lcme_extent.e_start: 0 lcme_extent.e_end: 65536 stripe_count: 1 stripe_size: 1048576 pattern: raid0 stripe_offset: -1 lcme_id: N/A lcme_mirror_id: N/A lcme_flags: 0 lcme_extent.e_start: 65536 lcme_extent.e_end: EOF stripe_count: 2 stripe_size: 1048576 pattern: raid0 stripe_offset: -1 [root@trevis-90vm2 lustre]# mkdir subdir [root@trevis-90vm2 lustre]# lfs setstripe --stripe-count 0 subdir [root@trevis-90vm2 lustre]# lfs getstripe --stripe-count subdir 2 But if the root fs has no PFL, but subdir has PFL layout, the dir created under subdir will do what --stripe-count 0 and --stripe-size 0 suppose to do as describe in the git log [root@trevis-90vm2 lustre]# lfs getstripe /mnt/lustre/ /mnt/lustre/ stripe_count: 1 stripe_size: 1048576 pattern: 0 stripe_offset: -1 [root@trevis-90vm2 lustre]# mkdir subdir2 [root@trevis-90vm2 lustre]# lfs setstripe -E 64k -c 1 -E eof -c 2 /mnt/lustre/subdir2/ [root@trevis-90vm2 lustre]# lfs getstripe subdir2/ subdir2/ lcm_layout_gen: 0 lcm_mirror_count: 1 lcm_entry_count: 2 lcme_id: N/A lcme_mirror_id: N/A lcme_flags: 0 lcme_extent.e_start: 0 lcme_extent.e_end: 65536 stripe_count: 1 stripe_size: 1048576 pattern: raid0 stripe_offset: -1 lcme_id: N/A lcme_mirror_id: N/A lcme_flags: 0 lcme_extent.e_start: 65536 lcme_extent.e_end: EOF stripe_count: 2 stripe_size: 1048576 pattern: raid0 stripe_offset: -1 [root@trevis-90vm2 lustre]# mkdir /mnt/lustre/subdir2/tdir2 [root@trevis-90vm2 lustre]# lfs getstripe --stripe-count /mnt/lustre/subdir2/tdir2/ 2 [root@trevis-90vm2 lustre]# lfs setstripe --stripe-count 0 subdir2/tdir2/ [root@trevis-90vm2 lustre]# lfs getstripe --stripe-count /mnt/lustre/subdir2/tdir2/ 1

            I found if use "lfs setstripe --stripe-count 0" or "--stripe-size 0" won't change the PFL layout to default stripe count or size, but the "--stripe-index 0" can do.

            That is because "--stripe-index 0" is not a "use the default value" argument, but rather "use OST0000" argument.

            The original patch http://review.whamcloud.com/577 "LU-64 Make "lfs getstripe" directory output consistent" that added sanity test_204a had this description:

            $ git log -S test_204a lustre/tests/sanity.sh
            
                LU-64 Make "lfs getstripe" directory output consistent.
                
                "lfs getstripe" should report the global default for any fields with
                a value that means "use the default". This patch introduces the
                following functionality:
                
                1. If "lfs getstripe" is called on a directory and finds that striping
                   EA is not set, the filesystem's defaults are looked up and printed.
                2. If the striping EA is set, but the striping count and/or striping
                   size has a value that means "use the default" (count = 0 and/or
                   size = 0), the filesystem's default for that specific striping
                   attribute is looked up and printed.
                3. A new option to "lfs getstripe" is introduced; the "--raw" or
                   "-R" option. If this option is specified, the previous two checks
                   are skipped. In other words, if the striping EA is not set, 0, 0,
                   -1, will be printed for the striping count, size, and offset
                   respectively. Also, if the striping EA is set, the values will be
                   printed without first converting them into their respective
                   defaults.
            
            adilger Andreas Dilger added a comment - I found if use " lfs setstripe --stripe-count 0 " or " --stripe-size 0 " won't change the PFL layout to default stripe count or size, but the " --stripe-index 0 " can do. That is because " --stripe-index 0 " is not a "use the default value" argument, but rather "use OST0000" argument. The original patch http://review.whamcloud.com/577 " LU-64 Make "lfs getstripe" directory output consistent " that added sanity test_204a had this description: $ git log -S test_204a lustre/tests/sanity.sh LU-64 Make "lfs getstripe" directory output consistent. "lfs getstripe" should report the global default for any fields with a value that means "use the default". This patch introduces the following functionality: 1. If "lfs getstripe" is called on a directory and finds that striping EA is not set, the filesystem's defaults are looked up and printed. 2. If the striping EA is set, but the striping count and/or striping size has a value that means "use the default" (count = 0 and/or size = 0), the filesystem's default for that specific striping attribute is looked up and printed. 3. A new option to "lfs getstripe" is introduced; the "--raw" or "-R" option. If this option is specified, the previous two checks are skipped. In other words, if the striping EA is not set, 0, 0, -1, will be printed for the striping count, size, and offset respectively. Also, if the striping EA is set, the values will be printed without first converting them into their respective defaults.

            People

              wc-triage WC Triage
              sarah Sarah Liu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: