Whamcloud - gitweb
b=18606
authornathan <nathan>
Thu, 26 Feb 2009 19:51:45 +0000 (19:51 +0000)
committernathan <nathan>
Thu, 26 Feb 2009 19:51:45 +0000 (19:51 +0000)
i=adigler
i=johann
use pool of "all" if specified pool is empty

lustre/lov/lov_pack.c
lustre/tests/sanity.sh

index 6dcdd3a..1cd8ef8 100644 (file)
@@ -484,20 +484,18 @@ 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)
-                                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)
+                                        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);
-
         }
 
         rc = lov_alloc_memmd(lsmp, stripe_count, lumv1->lmm_pattern, lmm_magic);
index b3e9b78..75822ce 100644 (file)
@@ -5851,6 +5851,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 =========================="