From d73f239bb1a0ddb8b953f5088688a9c8048299c8 Mon Sep 17 00:00:00 2001 From: braam Date: Thu, 22 Aug 2002 06:04:36 +0000 Subject: [PATCH] minor but important lov bug fixes Robert and I found out about. --- lustre/lov/lov_obd.c | 30 ++++++++++++++++-------------- lustre/mdc/mdc_request.c | 4 ++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index c804bd8..8f844e9 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -394,7 +394,7 @@ static int lov_open(struct lustre_handle *conn, struct obdo *oa, rc = obd_open(&lov->tgts[i].conn, &tmp, NULL); if (rc) { rc2 = rc; - CERROR("Error getattr object %Ld on %d\n", + CERROR("Error open object %Ld on %d\n", oa->o_id, i); } } @@ -426,8 +426,8 @@ static int lov_close(struct lustre_handle *conn, struct obdo *oa, tmp.o_id = md->lmd_oinfo[i].loi_id; rc = obd_close(&lov->tgts[i].conn, &tmp, NULL); - if (!rc) { - CERROR("Error getattr object %Ld on %d\n", + if (rc) { + CERROR("Error close object %Ld on %d\n", oa->o_id, i); } } @@ -438,7 +438,7 @@ static int lov_close(struct lustre_handle *conn, struct obdo *oa, #define log2(n) ffz(~(n)) #endif -/* compute offset in stripe i corresponds to offset "in" */ +/* compute offset in stripe i corresponding to offset "in" */ __u64 lov_offset(struct lov_stripe_md *md, __u64 in, int i) { __u32 ssz = md->lmd_stripe_size; @@ -460,7 +460,7 @@ __u64 lov_offset(struct lov_stripe_md *md, __u64 in, int i) return (__u64) out; } -/* compute offset in stripe i corresponds to offset "in" */ +/* compute offset in stripe i corresponding to offset "in" */ __u64 lov_stripe(struct lov_stripe_md *md, __u64 in, int *j) { __u32 ssz = md->lmd_stripe_size; @@ -597,7 +597,8 @@ static inline int lov_brw(int cmd, struct lustre_handle *conn, shift = stripeinfo[which].index; ioarr[shift + stripeinfo[which].subcount] = pga[i]; - ioarr[shift + stripeinfo[which].subcount].off = lov_offset(md, pga[i].pg->index * PAGE_SIZE, which); + ioarr[shift + stripeinfo[which].subcount].off = + lov_offset(md, pga[i].pg->index * PAGE_SIZE, which); stripeinfo[which].subcount++; } @@ -647,15 +648,16 @@ static int lov_enqueue(struct lustre_handle *conn, struct lov_stripe_md *md, continue; submd.lmd_object_id = md->lmd_oinfo[i].loi_id; - submd.lmd_easize = sizeof(submd); + submd.lmd_easize = sizeof(struct lov_mds_md); submd.lmd_stripe_count = md->lmd_stripe_count; /* XXX submd is not fully initialized here */ - rc = obd_enqueue(&(lov->tgts[i].conn), &submd, parent_lock, type, - &sub_ext, sizeof(sub_ext), mode, flags, cb, data, datalen, &(lockhs[i])); + rc = obd_enqueue(&(lov->tgts[i].conn), &submd, parent_lock, + type, &sub_ext, sizeof(sub_ext), mode, + flags, cb, data, datalen, &(lockhs[i])); // XXX add a lock debug statement here if (rc) { - CERROR("Error obd_enqueu object %Ld subobj %Ld\n", md->lmd_object_id, - md->lmd_oinfo[i].loi_id); + CERROR("Error obd_enqueue object %Ld subobj %Ld\n", + md->lmd_object_id, md->lmd_oinfo[i].loi_id); } } RETURN(rc); @@ -687,9 +689,9 @@ static int lov_cancel(struct lustre_handle *conn, struct lov_stripe_md *md, __u3 submd.lmd_object_id = md->lmd_oinfo[i].loi_id; submd.lmd_easize = sizeof(submd); rc = obd_cancel(&lov->tgts[i].conn, &submd, mode, &lockhs[i]); - if (!rc) { - CERROR("Error punch object %Ld subobj %Ld\n", md->lmd_object_id, - md->lmd_oinfo[i].loi_id); + if (rc) { + CERROR("Error cancel object %Ld subobj %Ld\n", + md->lmd_object_id, md->lmd_oinfo[i].loi_id); } } RETURN(rc); diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index b8cac01..fbc36b9 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -127,8 +127,8 @@ int mdc_getlovinfo(struct obd_device *obd, struct lustre_handle *mdc_connh, memcpy(desc, lustre_msg_buf(req->rq_repmsg, 0), sizeof(*desc)); *uuids = lustre_msg_buf(req->rq_repmsg, 1); lov_unpackdesc(desc); - mdc->cl_max_mdsize = sizeof(struct lov_stripe_md) + - desc->ld_tgt_count * sizeof(struct lov_oinfo); + mdc->cl_max_mdsize = sizeof(struct lov_mds_md) + + desc->ld_tgt_count * sizeof(struct lov_object_id); } EXIT; -- 1.8.3.1