Whamcloud - gitweb
fix capa renewal reply offset.
authorlsy <lsy>
Sat, 7 Oct 2006 14:05:09 +0000 (14:05 +0000)
committerlsy <lsy>
Sat, 7 Oct 2006 14:05:09 +0000 (14:05 +0000)
class_process_proc_param() compare lvar more accuratly.
code cleanup.

lustre/mdc/mdc_request.c
lustre/mdt/mdt_lib.c
lustre/obdclass/obd_config.c
lustre/obdclass/obd_mount.c

index e8dcc2d..c3539e7 100644 (file)
@@ -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);
index 233dac5..a0e4b22 100644 (file)
@@ -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))
index ab35ec4..397ee21 100644 (file)
@@ -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) {
index 6abac48..6931118 100644 (file)
@@ -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. */