From: wang di Date: Sun, 14 Jun 2015 00:26:04 +0000 (-0700) Subject: LU-6728 lfs: check if pool_name is NULL X-Git-Tag: 2.7.56~39 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=91f377258cfc85c74738965a57b7d531e0f427b4;p=fs%2Flustre-release.git 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 --- 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: ",