From 0e11028032d80487834c0a13624b26c491778de1 Mon Sep 17 00:00:00 2001 From: rread Date: Thu, 22 Aug 2002 18:36:11 +0000 Subject: [PATCH] - stripe md fixes --- lustre/lib/lov_pack.c | 8 +++++++- lustre/lov/lov_obd.c | 12 ++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lustre/lib/lov_pack.c b/lustre/lib/lov_pack.c index 74b8ab8..f4a9fe2 100644 --- a/lustre/lib/lov_pack.c +++ b/lustre/lib/lov_pack.c @@ -69,6 +69,12 @@ void lov_unpackmd(struct lov_stripe_md *md, struct lov_mds_md *mdsmd) md->lmd_stripe_size = mdsmd->lmd_stripe_size; md->lmd_stripe_pattern = mdsmd->lmd_stripe_pattern; - for (i=0; ilmd_stripe_count; i++) + for (i=0; ilmd_stripe_count; i++) { md->lmd_oinfo[i].loi_id = mdsmd->lmd_objects[i].l_object_id; + md->lmd_oinfo[i].loi_size = 0; + } } + + + + diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 8f844e9..55d14f6 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -313,17 +313,22 @@ static int lov_getattr(struct lustre_handle *conn, struct obdo *oa, RETURN(-ENODEV); lov = &export->exp_obd->u.lov; + oa->o_size = 0; for (i = 0; i < md->lmd_stripe_count; i++) { + if (md->lmd_oinfo[i].loi_id == 0) + continue; /* create data objects with "parent" OA */ memcpy(&tmp, oa, sizeof(tmp)); - oa->o_id = md->lmd_oinfo[i].loi_id; + tmp.o_id = md->lmd_oinfo[i].loi_id; rc = obd_getattr(&lov->tgts[i].conn, &tmp, NULL); if (!rc) { CERROR("Error getattr object %Ld on %d\n", - oa->o_id, i); + tmp.o_id, i); } /* XXX can do something more sophisticated here... */ + /* This some completely wrong. We only need the size from + the individual slices. */ if (i == 0 ) { obd_id id = oa->o_id; memcpy(oa, &tmp, sizeof(tmp)); @@ -331,7 +336,6 @@ static int lov_getattr(struct lustre_handle *conn, struct obdo *oa, } else { oa->o_size += tmp.o_size; } - } RETURN(rc); } @@ -687,7 +691,7 @@ static int lov_cancel(struct lustre_handle *conn, struct lov_stripe_md *md, __u3 continue; submd.lmd_object_id = md->lmd_oinfo[i].loi_id; - submd.lmd_easize = sizeof(submd); + submd.lmd_easize = sizeof(struct lov_mds_md); rc = obd_cancel(&lov->tgts[i].conn, &submd, mode, &lockhs[i]); if (rc) { CERROR("Error cancel object %Ld subobj %Ld\n", -- 1.8.3.1