Whamcloud - gitweb
LU-6626 utils: lfs_getstripe prints empty pool name 06/14906/2
authorLi Xi <lixi@ddn.com>
Thu, 21 May 2015 09:40:47 +0000 (17:40 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 28 May 2015 22:16:07 +0000 (22:16 +0000)
When the stripe version is V3, yet pool name is empty, the
lfs getstripe command will prints an empty pool name. That is
confusing since the user might think there is a pool for this
directory.

Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: I4338362331bc958686464bfdfea647c90244f818
Reviewed-on: http://review.whamcloud.com/14906
Tested-by: Jenkins
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/liblustreapi.c

index edd14a2..a16257d 100644 (file)
@@ -2648,7 +2648,8 @@ void llapi_lov_dump_user_lmm(struct find_param *param, char *path, int is_dir)
 
                strlcpy(pool_name, lmmv3->lmm_pool_name, sizeof(pool_name));
                objects = lmmv3->lmm_objects;
-               lov_dump_user_lmm_v1v3(&param->fp_lmd->lmd_lmm, pool_name,
+               lov_dump_user_lmm_v1v3(&param->fp_lmd->lmd_lmm,
+                                      pool_name[0] == '\0' ? NULL : pool_name,
                                       objects, path, is_dir,
                                       param->fp_obd_index, param->fp_max_depth,
                                       param->fp_verbose, param->fp_raw);
@@ -2661,9 +2662,10 @@ void llapi_lov_dump_user_lmm(struct find_param *param, char *path, int is_dir)
 
                lum = (struct lmv_user_md *)param->fp_lmv_md;
                strlcpy(pool_name, lum->lum_pool_name, sizeof(pool_name));
-               lmv_dump_user_lmm(lum, pool_name, path,
-                                 param->fp_obd_index, param->fp_max_depth,
-                                 param->fp_verbose);
+               lmv_dump_user_lmm(lum,
+                                 pool_name[0] == '\0' ? NULL : pool_name,
+                                 path, param->fp_obd_index,
+                                 param->fp_max_depth, param->fp_verbose);
                break;
        }
        default: