Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
b=15316
[fs/lustre-release.git]
/
lustre
/
lov
/
lov_ea.c
diff --git
a/lustre/lov/lov_ea.c
b/lustre/lov/lov_ea.c
index
07936e3
..
174e1fc
100755
(executable)
--- a/
lustre/lov/lov_ea.c
+++ b/
lustre/lov/lov_ea.c
@@
-51,18
+51,18
@@
static int lsm_lmm_verify_common(struct lov_mds_md *lmm, int lmm_bytes,
int stripe_count)
{
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;
}
CERROR("bad stripe count %d\n", stripe_count);
lov_dump_lmm_v1(D_WARNING, lmm);
return -EINVAL;
}
-
+
if (lmm->lmm_object_id == 0) {
CERROR("zero object id\n");
lov_dump_lmm_v1(D_WARNING, lmm);
return -EINVAL;
}
if (lmm->lmm_object_id == 0) {
CERROR("zero object id\n");
lov_dump_lmm_v1(D_WARNING, lmm);
return -EINVAL;
}
-
+
if (lmm->lmm_pattern != cpu_to_le32(LOV_PATTERN_RAID0)) {
CERROR("bad striping pattern\n");
lov_dump_lmm_v1(D_WARNING, lmm);
if (lmm->lmm_pattern != cpu_to_le32(LOV_PATTERN_RAID0)) {
CERROR("bad striping pattern\n");
lov_dump_lmm_v1(D_WARNING, lmm);
@@
-70,7
+70,9
@@
static int lsm_lmm_verify_common(struct lov_mds_md *lmm, int lmm_bytes,
}
if (lmm->lmm_stripe_size == 0 ||
}
if (lmm->lmm_stripe_size == 0 ||
- (__u64)le32_to_cpu(lmm->lmm_stripe_size)*stripe_count > 0xffffffff){
+ (stripe_count != -1 &&
+ (__u64)le32_to_cpu(lmm->lmm_stripe_size)*stripe_count >
+ 0xffffffff)) {
CERROR("bad stripe size %u\n",
le32_to_cpu(lmm->lmm_stripe_size));
lov_dump_lmm_v1(D_WARNING, lmm);
CERROR("bad stripe size %u\n",
le32_to_cpu(lmm->lmm_stripe_size));
lov_dump_lmm_v1(D_WARNING, lmm);
@@
-95,7
+97,7
@@
struct lov_stripe_md *lsm_alloc_plain(int stripe_count, int *size)
return NULL;;
for (i = 0; i < stripe_count; i++) {
return NULL;;
for (i = 0; i < stripe_count; i++) {
- OBD_SLAB_ALLOC(loi, lov_oinfo_slab,
SLAB_NOFS
, sizeof(*loi));
+ OBD_SLAB_ALLOC(loi, lov_oinfo_slab,
CFS_ALLOC_IO
, sizeof(*loi));
if (loi == NULL)
goto err;
lsm->lsm_oinfo[i] = loi;
if (loi == NULL)
goto err;
lsm->lsm_oinfo[i] = loi;
@@
-136,7
+138,7
@@
lsm_stripe_by_index_plain(struct lov_stripe_md *lsm, int *stripeno,
obd_off *lov_off, unsigned long *swidth)
{
if (swidth)
obd_off *lov_off, unsigned long *swidth)
{
if (swidth)
- *swidth = (ulong)lsm->lsm_stripe_size * lsm->lsm_stripe_count;
+ *swidth = (u
nsigned
long)lsm->lsm_stripe_size * lsm->lsm_stripe_count;
}
static void
}
static void
@@
-144,7
+146,7
@@
lsm_stripe_by_offset_plain(struct lov_stripe_md *lsm, int *stripeno,
obd_off *lov_off, unsigned long *swidth)
{
if (swidth)
obd_off *lov_off, unsigned long *swidth)
{
if (swidth)
- *swidth = (ulong)lsm->lsm_stripe_size * lsm->lsm_stripe_count;
+ *swidth = (u
nsigned
long)lsm->lsm_stripe_size * lsm->lsm_stripe_count;
}
static obd_off
}
static obd_off
@@
-327,7
+329,7
@@
lsm_stripe_by_index_join(struct lov_stripe_md *lsm, int *stripeno,
*stripeno -= le->le_loi_idx;
if (swidth)
*stripeno -= le->le_loi_idx;
if (swidth)
- *swidth = (ulong)lsm->lsm_stripe_size * le->le_stripe_count;
+ *swidth = (u
nsigned
long)lsm->lsm_stripe_size * le->le_stripe_count;
if (lov_off) {
struct lov_extent *lov_le = lovea_off2le(lsm, *lov_off);
if (lov_off) {
struct lov_extent *lov_le = lovea_off2le(lsm, *lov_off);
@@
-360,7
+362,7
@@
lsm_stripe_by_offset_join(struct lov_stripe_md *lsm, int *stripeno,
*stripeno -= le->le_loi_idx;
if (swidth)
*stripeno -= le->le_loi_idx;
if (swidth)
- *swidth = (ulong)lsm->lsm_stripe_size * le->le_stripe_count;
+ *swidth = (u
nsigned
long)lsm->lsm_stripe_size * le->le_stripe_count;
}
static obd_off
}
static obd_off
@@
-468,7
+470,7
@@
static int lsm_revalidate_join(struct lov_stripe_md *lsm,
LASSERT(ctxt);
if (lsm->lsm_array && lsm->lsm_array->lai_ext_array)
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,
CDEBUG(D_INFO, "get lsm logid: "LPU64":"LPU64"\n",
lsm->lsm_array->lai_array_id.lgl_oid,
@@
-476,7
+478,7
@@
static int lsm_revalidate_join(struct lov_stripe_md *lsm,
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)
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,
CDEBUG(D_INFO, "get lsm logid: "LPU64":"LPU64"\n",
lsm->lsm_array->lai_array_id.lgl_oid,
@@
-497,6
+499,8
@@
static int lsm_revalidate_join(struct lov_stripe_md *lsm,
out:
if (rc)
lovea_free_array_info(lsm);
out:
if (rc)
lovea_free_array_info(lsm);
+release_ctxt:
+ llog_ctxt_put(ctxt);
RETURN(rc);
}
RETURN(rc);
}
@@
-509,16
+513,15
@@
int lsm_destroy_join(struct lov_stripe_md *lsm, struct obdo *oa,
ENTRY;
LASSERT(md_exp != NULL);
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)
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);
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)
rc = llog_create(ctxt, &llh, &lsm->lsm_array->lai_array_id,
NULL);
if (rc)
@@
-530,6
+533,7
@@
int lsm_destroy_join(struct lov_stripe_md *lsm, struct obdo *oa,
}
llog_free_handle(llh);
out:
}
llog_free_handle(llh);
out:
+ llog_ctxt_put(ctxt);
RETURN(rc);
}
RETURN(rc);
}