RETURN(rc);
}
}
+ /* Any stripe count is forbidden on DoM component */
+ if (lum->lmm_stripe_count) {
+ CDEBUG(D_LAYOUT,
+ "invalid DoM layout stripe count %u, must be 0\n",
+ le16_to_cpu(lum->lmm_stripe_count));
+ RETURN(-EINVAL);
+ }
+
+ /* Any pool is forbidden on DoM component */
+ if (lum->lmm_magic == LOV_USER_MAGIC_V3) {
+ struct lov_user_md_v3 *v3 = (void *)lum;
+
+ if (v3->lmm_pool_name[0] != '\0') {
+ CDEBUG(D_LAYOUT,
+ "DoM component cannot have pool assigned\n");
+ RETURN(-EINVAL);
+ }
+ }
}
prev_end = le64_to_cpu(ext->e_end);
lov_pattern(v1->lmm_pattern) == LOV_PATTERN_MDT)
lod_comp->llc_stripe_count = v1->lmm_stripe_count;
+ if (lov_pattern(lod_comp->llc_pattern) == LOV_PATTERN_MDT &&
+ lod_comp->llc_stripe_count != 0) {
+ CDEBUG(D_LAYOUT, "%s: invalid stripe count: %u\n",
+ lod2obd(d)->obd_name,
+ lod_comp->llc_stripe_count);
+ GOTO(free_comp, rc = -EINVAL);
+ }
+
lod_comp->llc_stripe_offset = v1->lmm_stripe_offset;
lod_obj_set_pool(lo, i, pool_name);
- LASSERT(ergo(lov_pattern(lod_comp->llc_pattern) ==
- LOV_PATTERN_MDT, lod_comp->llc_stripe_count == 0));
-
if (pool_name == NULL)
continue;
migration_block = true;
break;
case 'C':
+ if (lsa.lsa_pattern == LLAPI_LAYOUT_MDT) {
+ fprintf(stderr,
+ "%s %s: -C|--overstripe-count incompatible with DoM layout\n",
+ progname, argv[0]);
+ goto usage_error;
+ }
lsa.lsa_pattern = LLAPI_LAYOUT_OVERSTRIPING;
/* fall through */
case 'c':
fprintf(stderr, "warning: '--ost-list' is "
"deprecated, use '--ost' instead\n");
#endif
+ if (lsa.lsa_pattern == LLAPI_LAYOUT_MDT) {
+ fprintf(stderr,
+ "%s %s: -o|--ost incompatible with DoM layout\n",
+ progname, argv[0]);
+ goto usage_error;
+ }
/* -o allows overstriping, and must note it because
* parse_targets is shared with MDT striping, which
* does not allow duplicates