From 546727ba97986fc99c8ea45d2c04d6a69fa921fd Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 8 Nov 2010 12:21:34 +0300 Subject: [PATCH] b=20101 a fix for lfs getstripe --pool a=Jacques-Charles Lafoucriere (CEA) a=Andreas Dilger i=Andreas Dilger i=Andrew Perepechko --- lustre/tests/sanity.sh | 4 ++-- lustre/utils/lfs.c | 5 ++++- lustre/utils/liblustreapi.c | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 6300216..c3e586f 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -7399,8 +7399,8 @@ run_test 200c "Set pool on a directory =================================" test_200d() { remote_mgs_nodsh && skip "remote MGS with nodsh" && return - res=$($GETSTRIPE --pool $POOL_DIR | awk '/^pool:/ {print $2}') - [ "$res" = $POOL ] || error "Pool on $POOL_DIR is $res, not $POOL" + res=$($GETSTRIPE --pool $POOL_DIR) + [ $res = $POOL ] || error "Pool on $POOL_DIR is $res, not $POOL" } run_test 200d "Check pool on a directory ===============================" diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 0875b93..996fbe8 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -860,7 +860,10 @@ static int lfs_getstripe(int argc, char **argv) } break; case 'p': - param.verbose |= VERBOSE_POOL; + if (!(param.verbose & VERBOSE_DETAIL)) { + param.verbose |= VERBOSE_POOL; + param.maxdepth = 0; + } break; case 'M': param.get_mdt_index = 1; diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 0854d8c..2167131 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -1434,8 +1434,10 @@ static void lov_dump_user_lmm_header(struct lov_user_md *lum, char *path, } if ((verbose & VERBOSE_POOL) && (pool_name != NULL)) { - llapi_printf(LLAPI_MSG_NORMAL, "pool: %s", pool_name); - is_dir = 1; + if (verbose & ~VERBOSE_POOL) + llapi_printf(LLAPI_MSG_NORMAL, "%spool: ", + prefix); + llapi_printf(LLAPI_MSG_NORMAL, "%s%c", pool_name, nl); } if (is_dir && (verbose != VERBOSE_OBJID)) -- 1.8.3.1