int stripe_count)
{
- if (stripe_count == 0) {
+ if (stripe_count == 0 || stripe_count > LOV_V1_INSANE_STRIPE_COUNT) {
CERROR("bad stripe count %d\n", stripe_count);
lov_dump_lmm_v1(D_WARNING, lmm);
return -EINVAL;
obd_off *lov_off, unsigned long *swidth)
{
if (swidth)
- *swidth = (ulong)lsm->lsm_stripe_size * lsm->lsm_stripe_count;
+ *swidth = (unsigned long)lsm->lsm_stripe_size * lsm->lsm_stripe_count;
}
static void
obd_off *lov_off, unsigned long *swidth)
{
if (swidth)
- *swidth = (ulong)lsm->lsm_stripe_size * lsm->lsm_stripe_count;
+ *swidth = (unsigned long)lsm->lsm_stripe_size * lsm->lsm_stripe_count;
}
static obd_off
*stripeno -= le->le_loi_idx;
if (swidth)
- *swidth = (ulong)lsm->lsm_stripe_size * le->le_stripe_count;
+ *swidth = (unsigned long)lsm->lsm_stripe_size * le->le_stripe_count;
if (lov_off) {
struct lov_extent *lov_le = lovea_off2le(lsm, *lov_off);
*stripeno -= le->le_loi_idx;
if (swidth)
- *swidth = (ulong)lsm->lsm_stripe_size * le->le_stripe_count;
+ *swidth = (unsigned long)lsm->lsm_stripe_size * le->le_stripe_count;
}
static obd_off
LASSERT(ctxt);
if (lsm->lsm_array && lsm->lsm_array->lai_ext_array)
- RETURN(0);
+ GOTO(release_ctxt, rc = 0);
CDEBUG(D_INFO, "get lsm logid: "LPU64":"LPU64"\n",
lsm->lsm_array->lai_array_id.lgl_oid,
OBD_ALLOC(lsm->lsm_array->lai_ext_array,lsm->lsm_array->lai_ext_count *
sizeof (struct lov_extent));
if (!lsm->lsm_array->lai_ext_array)
- RETURN(-ENOMEM);
+ GOTO(release_ctxt, rc = -ENOMEM);
CDEBUG(D_INFO, "get lsm logid: "LPU64":"LPU64"\n",
lsm->lsm_array->lai_array_id.lgl_oid,
out:
if (rc)
lovea_free_array_info(lsm);
+release_ctxt:
+ llog_ctxt_put(ctxt);
RETURN(rc);
}
ENTRY;
LASSERT(md_exp != NULL);
+ /*for those orphan inode, we should keep array id*/
+ if (!(oa->o_valid & OBD_MD_FLCOOKIE))
+ RETURN(rc);
+
ctxt = llog_get_context(md_exp->exp_obd, LLOG_LOVEA_REPL_CTXT);
if (!ctxt)
- GOTO(out, rc = -EINVAL);
+ RETURN(-EINVAL);
LASSERT(lsm->lsm_array != NULL);
- /*for those orphan inode, we should keep array id*/
- if (!(oa->o_valid & OBD_MD_FLCOOKIE))
- RETURN(0);
-
- LASSERT(ctxt != NULL);
rc = llog_create(ctxt, &llh, &lsm->lsm_array->lai_array_id,
NULL);
if (rc)
}
llog_free_handle(llh);
out:
+ llog_ctxt_put(ctxt);
RETURN(rc);
}