Whamcloud - gitweb
LU-6728 lfs: check if pool_name is NULL 96/15296/2
authorwang di <di.wang@intel.com>
Sun, 14 Jun 2015 00:26:04 +0000 (17:26 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 16 Jun 2015 16:03:48 +0000 (16:03 +0000)
It should check if the pool_name is NULL before
dumping pool information in lmv_dump_user_lmm().

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I2f3c016be919d099437bfdb0cf78a2a1ca88d57d
Reviewed-on: http://review.whamcloud.com/15296
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh
lustre/utils/liblustreapi.c

index cb24847..dcaeb98 100644 (file)
@@ -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"
index 46e3613..8dde0ce 100644 (file)
@@ -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:           ",