From 91f377258cfc85c74738965a57b7d531e0f427b4 Mon Sep 17 00:00:00 2001 From: wang di Date: Sat, 13 Jun 2015 17:26:04 -0700 Subject: [PATCH] LU-6728 lfs: check if pool_name is NULL It should check if the pool_name is NULL before dumping pool information in lmv_dump_user_lmm(). Signed-off-by: wang di Change-Id: I2f3c016be919d099437bfdb0cf78a2a1ca88d57d Reviewed-on: http://review.whamcloud.com/15296 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 2 ++ lustre/utils/liblustreapi.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index cb24847..dcaeb98 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -13029,6 +13029,8 @@ test_striped_dir() { local mode=$(stat -c%a $DIR/$tdir/striped_dir) [ "$mode" = "755" ] || error "expect 755 got $mode" + $LFS getdirstripe $DIR/$tdir/striped_dir > /dev/null 2>&1 || + error "getdirstripe failed" stripe_count=$($LFS getdirstripe -c $DIR/$tdir/striped_dir) if [ "$stripe_count" != "2" ]; then error "stripe_count is $stripe_count, expect 2" diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 46e3613..8dde0ce 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -2611,7 +2611,8 @@ void lmv_dump_user_lmm(struct lmv_user_md *lum, char *pool_name, } - if ((verbose & VERBOSE_POOL) && (pool_name[0] != '\0')) { + if ((verbose & VERBOSE_POOL) && pool_name != NULL && + pool_name[0] != '\0') { llapi_printf(LLAPI_MSG_NORMAL, "%s", separator); if (verbose & ~VERBOSE_POOL) llapi_printf(LLAPI_MSG_NORMAL, "%slmv_pool: ", -- 1.8.3.1