From: Andreas Dilger Date: Tue, 20 Mar 2018 23:37:04 +0000 (-0600) Subject: LU-10829 utils: don't print lmm_stripe_offset for DoM layout X-Git-Tag: 2.11.0-RC2~1 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=1184db3ee1420acd8ee3c29f6d74c2fcaffd6b32 LU-10829 utils: don't print lmm_stripe_offset for DoM layout 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 Change-Id: I5430ff74d26ad2acd51d07ec23810cc9033ebbe5 Reviewed-on: https://review.whamcloud.com/31702 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity-flr.sh b/lustre/tests/sanity-flr.sh index f5faf02..722d100 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -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 - local layout=$($LFS getstripe $tf2 | grep -A 4 lmm_objects) - $LFS mirror extend -N -f $tf2 $tf || error "merging $tf2 into $tf failed" diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 4b00539..1d3218a 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -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); + 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); @@ -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) && - !(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)