Whamcloud - gitweb
LU-11753 utils: print out DNE2 directory hash flags 43/33843/2
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 13 Dec 2018 00:37:50 +0000 (17:37 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 17 Dec 2018 19:34:53 +0000 (19:34 +0000)
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 <adilger@whamcloud.com>
Change-Id: Ib6b362f9eb993b5fa0562b3a51b54eaee1ccab07
Reviewed-on: https://review.whamcloud.com/33843
Reviewed-by: Stephan Thiell <sthiell@stanford.edu>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/liblustreapi.c

index 5f95d44..ad598b2 100644 (file)
@@ -2828,7 +2828,8 @@ void lmv_dump_user_lmm(struct lmv_user_md *lum, char *pool_name,
        }
 
        if (verbose & VERBOSE_HASH_TYPE) {
        }
 
        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)
 
                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, "%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";
                separator = "\n";
+
        }
 
        if (verbose & VERBOSE_OBJID && lum->lum_magic != LMV_USER_MAGIC) {
        }
 
        if (verbose & VERBOSE_OBJID && lum->lum_magic != LMV_USER_MAGIC) {