#define OBD_FAIL_MDS_REMOVE_COMMON_EA 0x13e
#define OBD_FAIL_MDS_ALLOW_COMMON_EA_SETTING 0x13f
#define OBD_FAIL_MDS_LOV_PREP_CREATE 0x141
+#define OBD_FAIL_MDS_REINT_DELAY 0x142
/* CMD */
#define OBD_FAIL_MDS_IS_SUBDIR_NET 0x180
struct lov_stripe_md *lsm);
int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
struct lov_mds_md *lmm, int lmm_bytes);
-int lov_setstripe(struct obd_export *exp,
+int lov_setstripe(struct obd_export *exp, int max_lmm_size,
struct lov_stripe_md **lsmp, struct lov_user_md *lump);
int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
struct lov_user_md *lump);
break;
}
case LL_IOC_LOV_SETSTRIPE:
- rc = lov_setstripe(exp, karg, uarg);
+ rc = lov_setstripe(exp, len, karg, uarg);
break;
case LL_IOC_LOV_GETSTRIPE:
rc = lov_getstripe(exp, karg, uarg);
RETURN(lsm_size);
}
-static int __lov_setstripe(struct obd_export *exp, struct lov_stripe_md **lsmp,
+static int __lov_setstripe(struct obd_export *exp, int max_lmm_size,
+ struct lov_stripe_md **lsmp,
struct lov_user_md *lump)
{
struct obd_device *obd = class_exp2obd(exp);
}
stripe_count = lov_get_stripecnt(lov, lumv1->lmm_stripe_count);
+ if (max_lmm_size) {
+ int max_stripes = (max_lmm_size -
+ lov_mds_md_size(0, lmm_magic)) /
+ sizeof(struct lov_ost_data_v1);
+ if (unlikely(max_stripes < stripe_count)) {
+ CDEBUG(D_IOCTL, "stripe count reset from %d to %d\n",
+ stripe_count, max_stripes);
+ stripe_count = max_stripes;
+ }
+ }
+
if (lmm_magic == LOV_USER_MAGIC_V3) {
struct pool_desc *pool;
* lmm_stripe_offset, and lmm_stripe_pattern. lmm_magic must be LOV_MAGIC.
* @lsmp is a pointer to an in-core stripe MD that needs to be filled in.
*/
-int lov_setstripe(struct obd_export *exp, struct lov_stripe_md **lsmp,
- struct lov_user_md *lump)
+int lov_setstripe(struct obd_export *exp, int max_lmm_size,
+ struct lov_stripe_md **lsmp, struct lov_user_md *lump)
{
int rc;
mm_segment_t seg;
seg = get_fs();
set_fs(KERNEL_DS);
- rc = __lov_setstripe(exp, lsmp, lump);
+ rc = __lov_setstripe(exp, max_lmm_size, lsmp, lump);
set_fs(seg);
RETURN(rc);
}
}
}
- rc = lov_setstripe(exp, lsmp, lump);
+ rc = lov_setstripe(exp, 0, lsmp, lump);
if (rc)
RETURN(rc);
if (!md_should_create(spec->sp_cr_flags))
RETURN(0);
-
+ lmm_size = ma->ma_lmm_size;
rc = mdd_lov_create(env, mdd, mdd_pobj, son, &lmm, &lmm_size,
spec, attr);
if (rc)
* first.
*/
if (S_ISREG(attr->la_mode)) {
+ lmm_size = ma->ma_lmm_size;
rc = mdd_lov_create(env, mdd, mdd_pobj, son, &lmm, &lmm_size,
spec, attr);
if (rc)
int rc = 0;
ENTRY;
- if (!md_should_create(create_flags))
+ if (!md_should_create(create_flags)) {
+ *lmm_size = 0;
RETURN(0);
-
+ }
oti_init(oti, NULL);
/* replay case, has objects already, only get lov from eadata */
XATTR_NAME_LOV);
if (rc > 0)
rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE,
- lov_exp, 0, &lsm, _lmm);
+ lov_exp, *lmm_size,
+ &lsm, _lmm);
+
if (rc)
GOTO(out_oti, rc);
}
GOTO(out_shrink, rc = err_serious(rc));
}
+ OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_REINT_DELAY, 10);
+
/* for replay no cookkie / lmm need, because client have this already */
if (info->mti_spec.no_create == 1) {
if (req_capsule_has_field(pill, &RMF_MDT_MD, RCL_SERVER))
}
run_test 50f "normal statfs one server in down =========================="
+test_51() {
+ local LOCAL_TIMEOUT=20
+
+ reformat
+ start_mds
+ start_ost
+ mount_client $MOUNT
+ check_mount || return 1
+
+ mkdir $MOUNT/d1
+ $LFS setstripe -c -1 $MOUNT/d1
+ #define OBD_FAIL_MDS_REINT_DELAY 0x142
+ do_facet $SINGLEMDS "lctl set_param fail_loc=0x142"
+ touch $MOUNT/d1/f1 &
+ local pid=$!
+ sleep 2
+ start_ost2 || return 2
+ wait $pid
+ stop_ost2 || return 3
+ cleanup
+}
+run_test 51 "Verify that mdt_reint handles RMF_MDT_MD correctly when an OST is added"
cleanup_gss
equals_msg `basename $0`: test complete