Whamcloud - gitweb
LU-10829 utils: don't print lmm_stripe_offset for DoM layout 02/31702/2
authorAndreas Dilger <andreas.dilger@intel.com>
Tue, 20 Mar 2018 23:37:04 +0000 (17:37 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 26 Mar 2018 20:40:03 +0000 (20:40 +0000)
Running "lfs getstripe" on a DoM file prints out a non-zero value for
"lmm_stripe_offset:" on the 'mdt' component, even though this doesn't
make any sense.  Also, it prints an "lmm_objects:" header for the
component, even though it does not have any objects allocated to it.

  lcm_layout_gen:    4
  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:   1048576
      lmm_stripe_count:  0
      lmm_stripe_size:   1048576
      lmm_pattern:       mdt
      lmm_layout_gen:    0
      lmm_stripe_offset: 2
      lmm_objects:

Always print '0' for lmm_stripe_offset of DoM components, and don't
print "lmm_objects:" for these components at all.

Test-Parameters: trivial testlist=sanity-dom,sanity-flr
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I5430ff74d26ad2acd51d07ec23810cc9033ebbe5
Reviewed-on: https://review.whamcloud.com/31702
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity-flr.sh
lustre/utils/liblustreapi.c

index f5faf02..722d100 100644 (file)
@@ -730,8 +730,6 @@ test_2() {
        $LFS setstripe -E 1M -S 1M -E EOF -c 1 $tf
        $LFS setstripe -E 2M -S 1M -E EOF -c -1 $tf2
 
        $LFS setstripe -E 1M -S 1M -E EOF -c 1 $tf
        $LFS setstripe -E 2M -S 1M -E EOF -c -1 $tf2
 
-       local layout=$($LFS getstripe $tf2 | grep -A 4 lmm_objects)
-
        $LFS mirror extend -N -f $tf2 $tf ||
                error "merging $tf2 into $tf failed"
 
        $LFS mirror extend -N -f $tf2 $tf ||
                error "merging $tf2 into $tf failed"
 
index 4b00539..1d3218a 100644 (file)
@@ -2603,6 +2603,8 @@ static void lov_dump_user_lmm_header(struct lov_user_md *lum, char *path,
                                     lum->lmm_stripe_offset ==
                                     (typeof(lum->lmm_stripe_offset))(-1) ? -1 :
                                     lum->lmm_stripe_offset);
                                     lum->lmm_stripe_offset ==
                                     (typeof(lum->lmm_stripe_offset))(-1) ? -1 :
                                     lum->lmm_stripe_offset);
+               else if (lov_pattern(lum->lmm_pattern) == LOV_PATTERN_MDT)
+                       llapi_printf(LLAPI_MSG_NORMAL, "0");
                else
                        llapi_printf(LLAPI_MSG_NORMAL, "%u",
                                     objects[0].l_ost_idx);
                else
                        llapi_printf(LLAPI_MSG_NORMAL, "%u",
                                     objects[0].l_ost_idx);
@@ -2656,7 +2658,8 @@ void lov_dump_user_lmm_v1v3(struct lov_user_md *lum, char *pool_name,
                                 flags);
 
        if (!is_dir && !skip_objs && (header & VERBOSE_OBJID) &&
                                 flags);
 
        if (!is_dir && !skip_objs && (header & VERBOSE_OBJID) &&
-           !(lum->lmm_pattern & LOV_PATTERN_F_RELEASED)) {
+           !(lum->lmm_pattern & LOV_PATTERN_F_RELEASED ||
+             lov_pattern(lum->lmm_pattern) == LOV_PATTERN_MDT)) {
                char *space = "      - ";
 
                if (indent)
                char *space = "      - ";
 
                if (indent)