class_process_proc_param() compare lvar more accuratly.
code cleanup.
{
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;
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);
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))
#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;
/* continue parsing other params */
continue;
}
+ keylen = sval - key;
sval++;
vallen = strlen(sval);
matched = 0;
/* 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) {
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. */