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

"lfs getdirstripe -y" doesn't print YAML formatted output

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.16.0
    • Lustre 2.16.0, Lustre 2.12.9
    • 3
    • 9223372036854775807

    Description

      It appears that the "lfs getdirstripe -y <striped_dir>" command does not print YAML-formatted output (the output is the same regardless of whether -y is used or not).

      Unsurprisingly, there is also no subtest that is using "lfs getdirstripe -y", which is why nobody noticed if it was broken and/or even worked in the first place.

      Looking at lmv_dump_user_lmm(), it appears that the "LDF_YAML" flag is being checked, which was in turn set in llapi_lov_dump_user_lmm() from "fp_yaml", but this appears to be ignored in the stripe-printing loop:

              if (verbose & VERBOSE_OBJID && lum->lum_magic != LMV_USER_MAGIC) {
                      llapi_printf(LLAPI_MSG_NORMAL, "%s", separator);
                      if (lum->lum_stripe_count > 0)
                              llapi_printf(LLAPI_MSG_NORMAL,
                                           "mdtidx\t\t FID[seq:oid:ver]\n");
                      for (i = 0; i < lum->lum_stripe_count; i++) {
                              int idx = objects[i].lum_mds;
                              struct lu_fid *fid = &objects[i].lum_fid;
      
                              if ((obdindex == OBD_NOT_FOUND) || (obdindex == idx))
                                      llapi_printf(LLAPI_MSG_NORMAL,
                                                   "%6u\t\t "DFID"\t\t%s\n",
                                                  idx, PFID(fid),
                                                  obdindex == idx ? " *" : "");
                      }
              }
      

      It would also make sense to print the lmv_pool line in the header block before the dirstripes, should there ever be an MDT pool added.

      The behavior of the "-v|--verbose" flag is also puzzling, since using it will print nothing when "lfs getdirstripe" is run.

      Attachments

        Issue Links

          Activity

            [LU-16491] "lfs getdirstripe -y" doesn't print YAML formatted output

            "Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/55938
            Subject: LU-16491 lfs: test getdirstripe YAML
            Project: fs/lustre-release
            Branch: b2_15
            Current Patch Set: 1
            Commit: c273f157ba14f53c1a32b921dde1d636cb66d67d

            gerrit Gerrit Updater added a comment - "Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/55938 Subject: LU-16491 lfs: test getdirstripe YAML Project: fs/lustre-release Branch: b2_15 Current Patch Set: 1 Commit: c273f157ba14f53c1a32b921dde1d636cb66d67d
            pjones Peter Jones added a comment -

            Merged for 2.16

            pjones Peter Jones added a comment - Merged for 2.16

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/55346/
            Subject: LU-16491 utils: update getdirstripe yaml format
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 45c557ece5186800f5567df7e1c58909bb25b338

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/55346/ Subject: LU-16491 utils: update getdirstripe yaml format Project: fs/lustre-release Branch: master Current Patch Set: Commit: 45c557ece5186800f5567df7e1c58909bb25b338

            "Frederick Dilger <fdilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/55346
            Subject: LU-16491 utils: update getdirstripe yaml format
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 457f455ff29af425a3547544d53270c5c856ecfe

            gerrit Gerrit Updater added a comment - "Frederick Dilger <fdilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/55346 Subject: LU-16491 utils: update getdirstripe yaml format Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 457f455ff29af425a3547544d53270c5c856ecfe
            adilger Andreas Dilger added a comment - - edited

            This patch didn't really solve the problem.

            # lfs setdirstripe -c 3 /mnt/testfs/striped
            # lfs getdirstripe -v -y /mnt/testfs/striped
            lmv_stripe_count: 3
            lmv_stripe_offset: 2
            lmv_hash_type: crush
            mdtidx           FID[seq:oid:ver]
                 2           [0x280000400:0x4:0x0]  
                 3           [0x2c0000401:0x4:0x0]  
                 0           [0x200000402:0x4:0x0] 
            

            The stripes are not printed in YAML format as they are for a regular file like "lfs getstripe -y" does:

            # lfs getstripe -v -y /mnt/testfs/plain 
            lmm_magic:         0x0BD10BD0
            lmm_seq:           0x200000405
            lmm_object_id:     0x54f
            lmm_fid:           0x200000405:0x54f:0x0
            lmm_stripe_count:  2
            lmm_stripe_size:   1048576
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: 1
            lmm_objects:
                  - l_ost_idx: 1
                    l_fid:     0x340000403:0x90d:0x0
                  - l_ost_idx: 2
                    l_fid:     0x380000403:0x903:0x0
            

            The "-v" option should print the layout magic, "self" FID (whether the directory is striped or not), and the "migrating" fields lmv_migrate_offset and lmv_migrate_hash if LMV_HASH_FLAG_MIGRATION is set, etc.

            adilger Andreas Dilger added a comment - - edited This patch didn't really solve the problem. # lfs setdirstripe -c 3 /mnt/testfs/striped # lfs getdirstripe -v -y /mnt/testfs/striped lmv_stripe_count: 3 lmv_stripe_offset: 2 lmv_hash_type: crush mdtidx FID[seq:oid:ver] 2 [0x280000400:0x4:0x0] 3 [0x2c0000401:0x4:0x0] 0 [0x200000402:0x4:0x0] The stripes are not printed in YAML format as they are for a regular file like " lfs getstripe -y " does: # lfs getstripe -v -y /mnt/testfs/plain lmm_magic: 0x0BD10BD0 lmm_seq: 0x200000405 lmm_object_id: 0x54f lmm_fid: 0x200000405:0x54f:0x0 lmm_stripe_count: 2 lmm_stripe_size: 1048576 lmm_pattern: raid0 lmm_layout_gen: 0 lmm_stripe_offset: 1 lmm_objects: - l_ost_idx: 1 l_fid: 0x340000403:0x90d:0x0 - l_ost_idx: 2 l_fid: 0x380000403:0x903:0x0 The " -v " option should print the layout magic, "self" FID (whether the directory is striped or not), and the "migrating" fields lmv_migrate_offset and lmv_migrate_hash if LMV_HASH_FLAG_MIGRATION is set, etc.
            pjones Peter Jones added a comment -

            Landed for 2.16

            pjones Peter Jones added a comment - Landed for 2.16

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/50208/
            Subject: LU-16491 lfs: test getdirstripe YAML
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 25a53cdc80a03df42aa884cf85dfc725876994f4

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/50208/ Subject: LU-16491 lfs: test getdirstripe YAML Project: fs/lustre-release Branch: master Current Patch Set: Commit: 25a53cdc80a03df42aa884cf85dfc725876994f4

            "Timothy Day <timday@amazon.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50208
            Subject: LU-16491 lfs: test getdirstripe YAML
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: cf3a37ba5d39b0c0e9305b3186c834e3ff5d8170

            gerrit Gerrit Updater added a comment - "Timothy Day <timday@amazon.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50208 Subject: LU-16491 lfs: test getdirstripe YAML Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: cf3a37ba5d39b0c0e9305b3186c834e3ff5d8170

            People

              fdilger Fred Dilger
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: