.RB ' "lfs getstripe -d" '.
.TP
.BR --clear-fixed
-Do not set LMV_HASH_FIXED_FLAG upon migrating the directory. It allows a striped dir
+Do not set LMV_HASH_FLAG_FIXED upon migrating the directory. It allows a striped dir
with only one stripe to be converted to a plain directory.
.TP
.BR -H ", " --mdt-hash=\fIHASH_TYPE\fR
struct dt_insert_rec *rec = &info->lti_dt_rec;
int i;
int rc;
-
ENTRY;
+
/* lum is used to know whether it's replay */
LASSERT(lum);
if (!S_ISDIR(dt->do_lu.lo_header->loh_attr))
rc = lod_sub_insert(env, dt_object_child(dt),
(const struct dt_rec *)rec,
(const struct dt_key *)stripe_name, th);
+ if (rc == -EEXIST) {
+ CDEBUG(D_INFO, DFID": can't insert stripe %i "DFID"\n",
+ PFID(lod_object_fid(lo)), i,
+ PFID(lu_object_fid(&dt->do_lu)));
+ continue;
+ }
if (rc != 0)
GOTO(out, rc);
RETURN(rc);
/* No stripes */
- if (lo->ldo_dir_stripe_count <= 1)
+ if (lo->ldo_dir_stripe_count == 0)
RETURN(0);
slave_locks_size = offsetof(typeof(*slave_locks),
LASSERT(le32_to_cpu(lum->lum_magic) == LMV_USER_MAGIC);
LASSERT(le32_to_cpu(lum->lum_stripe_offset) == LMV_OFFSET_DEFAULT);
- saved_count = lo->ldo_dir_stripes_allocated;
+ saved_count = lo->ldo_dir_stripe_count;
stripe_count = le32_to_cpu(lum->lum_stripe_count);
/* if the split target is overstriped, we need to put that flag in the
if (!stripes)
RETURN(-ENOMEM);
- for (i = 0; i < lo->ldo_dir_stripes_allocated; i++)
+ for (i = 0; i < saved_count; i++)
stripes[i] = lo->ldo_stripe[i];
lod_qos_statfs_update(env, lod, &lod->lod_mdt_descs);
createmany -d $DIR/$tdir/d 100 ||
error "create dirs under remote dir failed"
- for c in $(seq $((MDSCOUNT - 1)) -1 1); do
+ for ((c = $MDSCOUNT - 1; c >= 1; c--)); do
local mdt_hash="crush"
do_nodes $mdts "$LCTL set_param mdt.*.md_stats=clear >/dev/null"
(( delta < 200 / c + 4 )) ||
error "$delta files migrated >= $((200 / c + 4))"
done
+
+ # and restripe to -c 2
+ echo Splitting the dir back to 2 stripes.
+ $LFS setdirstripe -c 2 $DIR/$tdir || {
+ $LFS getdirstripe $DIR/$tdir
+ error "split $tdir to 2 stripes failed"
+ }
+ wait_update $HOSTNAME \
+ "$LFS getdirstripe -H $DIR/$tdir" "crush" $timeout ||
+ error "dir split not finished"
}
run_test 230p "dir merge"