From 5414bfc9f501d1697641b2b9fb58273ac261a6f6 Mon Sep 17 00:00:00 2001 From: tappro Date: Wed, 27 Sep 2006 20:48:51 +0000 Subject: [PATCH] - fix issues with wire structures and swabbing - initialize some values that can be uninitialized --- lustre/include/lustre/lustre_idl.h | 6 +++--- lustre/osd/osd_handler.c | 2 +- lustre/ost/ost_handler.c | 2 +- lustre/ptlrpc/pack_generic.c | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 98883d0..156d076 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -477,12 +477,12 @@ struct obd_connect_data { __u32 ocd_version; /* lustre release version number */ __u32 ocd_grant; /* initial cache grant amount (bytes) */ __u32 ocd_index; /* LOV index to connect to */ - __u32 ocd_group; /* MDS group on OST */ __u32 ocd_brw_size; /* Maximum BRW size in bytes */ __u64 ocd_ibits_known; /* inode bits this client understands */ __u32 ocd_nllu; /* non-local-lustre-user */ __u32 ocd_nllg; /* non-local-lustre-group */ - __u64 padding1; /* also fix lustre_swab_connect */ + __u32 ocd_group; /* MDS group on OST */ + __u32 padding1; /* also fix lustre_swab_connect */ __u64 padding2; /* also fix lustre_swab_connect */ __u64 padding3; /* also fix lustre_swab_connect */ __u64 padding4; /* also fix lustre_swab_connect */ @@ -1026,7 +1026,7 @@ struct mdt_epoch { __u32 flags; }; -extern void lustre_swab_mdt_epoch (struct mdt_body *b); +extern void lustre_swab_mdt_epoch (struct mdt_epoch *b); struct lustre_md { struct mdt_body *body; diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index d7125c8..7b95d45 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -2310,7 +2310,7 @@ static int capa_is_sane(const struct lu_context *ctx, { struct obd_capa *c; struct osd_thread_info *oti = lu_context_key_get(ctx, &osd_key); - int i, rc; + int i, rc = 0; ENTRY; c = capa_lookup(capa); diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 00d3cbf..e73fbc9 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -80,7 +80,7 @@ static int ost_destroy(struct obd_export *exp, struct ptlrpc_request *req, struct obd_trans_info *oti) { struct ost_body *body, *repbody; - struct lustre_capa *capa; + struct lustre_capa *capa = NULL; int rc, size[2] = { sizeof(struct ptlrpc_body), sizeof(*body) }; ENTRY; diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index 33829dd..9177ae1 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -1508,6 +1508,7 @@ void lustre_swab_connect(struct obd_connect_data *ocd) __swab64s(&ocd->ocd_ibits_known); __swab32s(&ocd->ocd_nllu); __swab32s(&ocd->ocd_nllg); + __swab32s(&ocd->ocd_group); CLASSERT(offsetof(typeof(*ocd), padding1) != 0); CLASSERT(offsetof(typeof(*ocd), padding2) != 0); CLASSERT(offsetof(typeof(*ocd), padding3) != 0); @@ -1661,7 +1662,7 @@ void lustre_swab_mdt_body (struct mdt_body *b) __swab32s (&b->max_cookiesize); } -void lustre_swab_mdt_epoch (struct mdt_body *b) +void lustre_swab_mdt_epoch (struct mdt_epoch *b) { /* handle is opaque */ __swab64s (&b->ioepoch); -- 1.8.3.1