From 1631b1f19a75090c1851953d25743d2a5ea2bc92 Mon Sep 17 00:00:00 2001 From: lsy Date: Sat, 7 Oct 2006 14:05:09 +0000 Subject: [PATCH] fix capa renewal reply offset. class_process_proc_param() compare lvar more accuratly. code cleanup. --- lustre/mdc/mdc_request.c | 7 +++---- lustre/mdt/mdt_lib.c | 2 +- lustre/obdclass/obd_config.c | 6 ++++-- lustre/obdclass/obd_mount.c | 3 --- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index e8dcc2d..c3539e7 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1619,7 +1619,7 @@ static int mdc_interpret_renew_capa(struct ptlrpc_request *req, void *unused, { struct obd_capa *oc = req->rq_async_args.pointer_arg[0]; renew_capa_cb_t cb = req->rq_async_args.pointer_arg[1]; - struct mds_body *body = NULL; + struct mdt_body *body = NULL; struct lustre_capa *capa; ENTRY; @@ -1638,10 +1638,9 @@ static int mdc_interpret_renew_capa(struct ptlrpc_request *req, void *unused, if ((body->valid & OBD_MD_FLOSSCAPA) == 0) GOTO(out, capa = ERR_PTR(-EFAULT)); - capa = lustre_unpack_capa(req->rq_repmsg, REPLY_REC_OFF); + capa = lustre_unpack_capa(req->rq_repmsg, REPLY_REC_OFF + 1); if (!capa) - capa = ERR_PTR(-EFAULT); - + GOTO(out, capa = ERR_PTR(-EFAULT)); EXIT; out: cb(oc, capa); diff --git a/lustre/mdt/mdt_lib.c b/lustre/mdt/mdt_lib.c index 233dac5..a0e4b22 100644 --- a/lustre/mdt/mdt_lib.c +++ b/lustre/mdt/mdt_lib.c @@ -501,7 +501,7 @@ void mdt_shrink_reply(struct mdt_thread_info *info, int offset, offset += !!md_size; lustre_shrink_reply(req, offset, acl_size, 1); offset += !!acl_size; - if (mdscapa && !(body->valid & OBD_MD_FLMDSCAPA)) + if (mdscapa && !(body->valid & (OBD_MD_FLMDSCAPA | OBD_MD_FLOSSCAPA))) lustre_shrink_reply(req, offset, 0, 1); offset += mdscapa; if (osscapa && !(body->valid & OBD_MD_FLOSSCAPA)) diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index ab35ec4..397ee21 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -839,7 +839,7 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, #ifdef __KERNEL__ struct lprocfs_vars *var; char *key, *sval; - int i, vallen; + int i, keylen, vallen; int matched = 0, j = 0; int rc = 0; ENTRY; @@ -863,6 +863,7 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, /* continue parsing other params */ continue; } + keylen = sval - key; sval++; vallen = strlen(sval); matched = 0; @@ -870,7 +871,8 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, /* Search proc entries */ while (lvars[j].name) { var = &lvars[j]; - if (class_match_param(key, (char *)var->name, 0) == 0) { + if (class_match_param(key, (char *)var->name, 0) == 0 && + keylen == strlen(var->name)) { matched++; rc = -EROFS; if (var->write_fptr) { diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 6abac48..6931118 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -1906,9 +1906,6 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) if (rc) goto invalid; clear++; - } else if (strncmp(s1, "capa=", 5) == 0) { - lmd->lmd_nllu = simple_strtoul(s1 + 5, NULL, 10); - clear++; } /* Linux 2.4 doesn't pass the device, so we stuck it at the end of the options. */ -- 1.8.3.1