From 795eea12271f5c1bab3414803db3538d7c266d66 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 12 Dec 2018 17:37:50 -0700 Subject: [PATCH] LU-11753 utils: print out DNE2 directory hash flags There may be flags stored in the lmv_hash_type field, such as "LMV_HASH_FLAG_MIGRATION" that is set while the directory is being migrated. Print out the flag from "lfs getdirstripe". This is still missing support for "lfs find" to find directories that have incomplete migration. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: Ib6b362f9eb993b5fa0562b3a51b54eaee1ccab07 Reviewed-on: https://review.whamcloud.com/33843 Reviewed-by: Stephan Thiell Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- lustre/utils/liblustreapi.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 5f95d44..ad598b2 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -2828,7 +2828,8 @@ void lmv_dump_user_lmm(struct lmv_user_md *lum, char *pool_name, } if (verbose & VERBOSE_HASH_TYPE) { - unsigned int type = lum->lum_hash_type; + unsigned int type = lum->lum_hash_type & LMV_HASH_TYPE_MASK; + unsigned int flags = lum->lum_hash_type & ~LMV_HASH_TYPE_MASK; llapi_printf(LLAPI_MSG_NORMAL, "%s", separator); if (verbose & ~VERBOSE_HASH_TYPE) @@ -2837,9 +2838,18 @@ void lmv_dump_user_lmm(struct lmv_user_md *lum, char *pool_name, llapi_printf(LLAPI_MSG_NORMAL, "%s", mdt_hash_name[type]); else - llapi_printf(LLAPI_MSG_NORMAL, "%d", - (int)type); + llapi_printf(LLAPI_MSG_NORMAL, "%#x", type); + + if (flags & LMV_HASH_FLAG_MIGRATION) + llapi_printf(LLAPI_MSG_NORMAL, ",migrating"); + if (flags & LMV_HASH_FLAG_DEAD) + llapi_printf(LLAPI_MSG_NORMAL, ",dead"); + if (flags & LMV_HASH_FLAG_BAD_TYPE) + llapi_printf(LLAPI_MSG_NORMAL, ",bad_type"); + if (flags & LMV_HASH_FLAG_LOST_LMV) + llapi_printf(LLAPI_MSG_NORMAL, ",lost_lmv"); separator = "\n"; + } if (verbose & VERBOSE_OBJID && lum->lum_magic != LMV_USER_MAGIC) { -- 1.8.3.1