if (shrink) {
struct lov_oinfo *loi;
- int i = 0;
- for (loi = lsm->lsm_oinfo; i < lsm->lsm_stripe_count;
- i++, loi++) {
- kms = lov_size_to_stripe(lsm, size, i);
+ for (loi = lsm->lsm_oinfo; stripe < lsm->lsm_stripe_count;
+ stripe++, loi++) {
+ kms = lov_size_to_stripe(lsm, size, stripe);
loi->loi_kms = loi->loi_rss = kms;
+ CDEBUG(D_INODE,
+ "stripe %d KMS %sing "LPU64"->"LPU64"\n",
+ stripe, kms > loi->loi_kms ? "increas":"shrink",
+ loi->loi_kms, kms);
}
RETURN(0);
}
CWARN("Please update config and run --write-conf on MDS\n");
desc->ld_default_stripe_size = PTLRPC_MAX_BRW_SIZE;
+ } else if (desc->ld_default_stripe_size & (LOV_MIN_STRIPE_SIZE - 1)) {
+ CWARN("default_stripe_size "LPU64" isn't a multiple of %lu\n",
+ desc->ld_default_stripe_size, LOV_MIN_STRIPE_SIZE);
+ CWARN("Please update config and run --write-conf on MDS\n");
+
+ desc->ld_default_stripe_size &= ~(LOV_MIN_STRIPE_SIZE - 1);
}
/* Because of 64-bit divide/mod operations only work with a 32-bit
* divisor in a 32-bit kernel, we cannot support a stripe width
- * of 4GB or larger on 32-bit CPUs.
- */
+ * of 4GB or larger on 32-bit CPUs. */
count = desc->ld_default_stripe_count;
- if (count && (count * desc->ld_default_stripe_size) > ~0UL) {
+ if ((count ? count : desc->ld_tgt_count) *
+ desc->ld_default_stripe_size > ~0UL) {
CERROR("LOV: stripe width "LPU64"x%u > %lu on 32-bit system\n",
desc->ld_default_stripe_size, count, ~0UL);
RETURN(-EINVAL);
}
-
+
/* Allocate space for target list */
if (desc->ld_tgt_count)
count = desc->ld_tgt_count;
RETURN(rc);
}
-#define ASSERT_LSM_MAGIC(lsmp) \
-do { \
- LASSERT((lsmp) != NULL); \
- LASSERTF((lsmp)->lsm_magic == LOV_MAGIC, "%p, %x", \
- (lsmp), (lsmp)->lsm_magic); \
+#define ASSERT_LSM_MAGIC(lsmp) \
+do { \
+ LASSERT((lsmp) != NULL); \
+ LASSERTF((lsmp)->lsm_magic == LOV_MAGIC, "%p->lsm_magic=%x\n", \
+ (lsmp), (lsmp)->lsm_magic); \
} while (0)
static int lov_destroy(struct obd_export *exp, struct obdo *oa,
obd_id objid = src_oa->o_id;
int i;
ENTRY;
-
+
ASSERT_LSM_MAGIC(lsm);
LASSERT(oti);
if (src_oa->o_valid & OBD_MD_FLCOOKIE)
LASSERT(oti->oti_logcookies);
-
+
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
for (i = 0, loi = lsm->lsm_oinfo; i < stripe_count; i++, loi++) {
/* XXX LOV STACKING call down to osc_packmd() to do packing */
- LASSERT(loi->loi_id);
+ LASSERTF(loi->loi_id, "lmm_oid "LPU64" stripe %u/%u idx %u\n",
+ lmm->lmm_object_id, i, stripe_count, loi->loi_ost_idx);
lmm->lmm_objects[i].l_object_id = cpu_to_le64(loi->loi_id);
lmm->lmm_objects[i].l_object_gr = cpu_to_le64(loi->loi_gr);
lmm->lmm_objects[i].l_ost_gen = cpu_to_le32(loi->loi_ost_gen);
/* 64kB is the largest common page size we see (ia64), and matches the
* check in lfs */
- if (lum.lmm_stripe_size & (65536 - 1)) {
- CDEBUG(D_IOCTL, "stripe size %u not multiple of 64kB\n",
- lum.lmm_stripe_size);
- RETURN(-EINVAL);
+ if (lum.lmm_stripe_size & (LOV_MIN_STRIPE_SIZE - 1)) {
+ CDEBUG(D_IOCTL, "stripe size %u not multiple of %lu, fixing\n",
+ lum.lmm_stripe_size, LOV_MIN_STRIPE_SIZE);
+ lum.lmm_stripe_size = LOV_MIN_STRIPE_SIZE;
}
if ((lum.lmm_stripe_offset >= lov->desc.ld_active_tgt_count) &&