From: nathan Date: Thu, 26 Feb 2009 19:16:08 +0000 (+0000) Subject: b=18606 X-Git-Tag: v1_8_0_110~229 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=83814b5889fa2a76bb011aa6c842285b8168b0b6;p=fs%2Flustre-release.git b=18606 i=adilger i=johann use pool of "all" if specified pool is empty --- diff --git a/lustre/lov/lov_pack.c b/lustre/lov/lov_pack.c index 93474f2..9d15b1a 100644 --- a/lustre/lov/lov_pack.c +++ b/lustre/lov/lov_pack.c @@ -484,23 +484,22 @@ int lov_setstripe(struct obd_export *exp, struct lov_stripe_md **lsmp, struct pool_desc *pool; pool = lov_find_pool(lov, lumv3.lmm_pool_name); - if (pool == NULL) - RETURN(-EINVAL); - - if (lumv1->lmm_stripe_offset != - (typeof(lumv1->lmm_stripe_offset))(-1)) { - rc = lov_check_index_in_pool(lumv1->lmm_stripe_offset, - pool); - if (rc < 0) { - lov_pool_putref(pool); - RETURN(-EINVAL); + if (pool != NULL) { + if (lumv1->lmm_stripe_offset != + (typeof(lumv1->lmm_stripe_offset))(-1)) { + rc = lov_check_index_in_pool( + lumv1->lmm_stripe_offset, pool); + if (rc < 0) { + lov_pool_putref(pool); + RETURN(-EINVAL); + } } - } - if (stripe_count > pool_tgt_count(pool)) - stripe_count = pool_tgt_count(pool); + if (stripe_count > pool_tgt_count(pool)) + stripe_count = pool_tgt_count(pool); - lov_pool_putref(pool); + lov_pool_putref(pool); + } } rc = lov_alloc_memmd(lsmp, stripe_count, lumv1->lmm_pattern, lmm_magic); diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 2b7f1f0..fadbbf8 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -5867,6 +5867,9 @@ test_200h() { done wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$POOL" ""\ || error "Pool $FSNAME.$POOL cannot be drained" + # striping on an empty pool should fall back to "pool of everything" + $SETSTRIPE -p $POOL ${POOL_FILE}/$tfile || \ + error "failed to create file with empty pool" } run_test 200h "Remove all targets from a pool =========================="