# 2. test option --copy
$LFS_MIGRATE -y --copy $f_copy $f_mgrt ||
error "cannot migrate $f_mgrt with --copy $f_copy"
- layout_before=$(get_layout_param $f_copy)
- layout_after=$(get_layout_param $f_mgrt)
+ layout_before=$(SKIP_INDEX=yes get_layout_param $f_copy)
+ layout_after=$(SKIP_INDEX=yes get_layout_param $f_mgrt)
[ "$layout_after" == "$layout_before" ] ||
error "lfs_migrate --copy: $layout_after != $layout_before"
}
test_mkdir "$dir" || error "cannot create dir $dir"
$LFS setstripe $layout $f_comp ||
error "cannot setstripe $f_comp with layout $layout"
- layout_before=$(get_layout_param $f_comp)
+ layout_before=$(SKIP_INDEX=yes get_layout_param $f_comp)
dd if=/dev/zero of=$f_comp bs=1M count=4
# 1. migrate a comp layout file by lfs_migrate
$LFS_MIGRATE -y $f_comp || error "cannot migrate $f_comp by lfs_migrate"
- layout_after=$(get_layout_param $f_comp)
+ layout_after=$(SKIP_INDEX=yes get_layout_param $f_comp)
[ "$layout_before" == "$layout_after" ] ||
error "lfs_migrate: $layout_before != $layout_after"
# 2. migrate a comp layout file by lfs migrate
$LFS migrate $f_comp || error "cannot migrate $f_comp by lfs migrate"
- layout_after=$(get_layout_param $f_comp)
+ layout_after=$(SKIP_INDEX=yes get_layout_param $f_comp)
[ "$layout_before" == "$layout_after" ] ||
error "lfs migrate: $layout_before != $layout_after"
}
if (migrate_mdt_mode) {
result = llapi_migrate_mdt(fname, &migrate_mdt_param);
} else if (migrate_mode) {
+ if (from_copy) {
+ /*
+ * Strip the source layout of specific
+ * OST object/index values.
+ */
+ result = llapi_layout_ost_index_set(layout, 0,
+ LLAPI_LAYOUT_DEFAULT);
+ if (result) {
+ fprintf(stderr,
+ "%s: set default ost index failed: %s\n",
+ progname, strerror(errno));
+ result = -errno;
+ goto error;
+ }
+ }
+
result = lfs_migrate(fname, migration_flags, param,
layout, bandwidth_bytes_sec,
stats_flag, stats_interval_sec);