Whamcloud - gitweb
LU-2309 config: ignore unknown configuration param
authorYu Jian <yujian@whamcloud.com>
Fri, 23 Nov 2012 12:57:27 +0000 (20:57 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 14 Dec 2012 05:10:53 +0000 (00:10 -0500)
Client or server should not fail to mount if it hits
a configuration parameter that it doesn't understand.
This patch fixes class_process_config() to meet
the above requirement.

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: Ida537193459f08d804fc4c0f1f72630b416440e3
Reviewed-on: http://review.whamcloud.com/4663
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/obdclass/obd_config.c

index cc6a84a..57408f3 100644 (file)
@@ -1118,16 +1118,19 @@ int class_process_config(struct lustre_cfg *lcfg)
                     client_process_config) {
                         err = (*client_process_config)(lcfg);
                         GOTO(out, err);
-                } else if ((class_match_param(lustre_cfg_string(lcfg, 1),
-                                              PARAM_SYS, &tmp) == 0)) {
-                        /* Global param settings */
-                        err = class_set_global(tmp, lcfg->lcfg_num);
-                        /* Note that since LCFG_PARAM is LCFG_REQUIRED, new
-                           unknown globals would cause config to fail */
-                        if (err)
-                                CWARN("Ignoring unknown param %s\n", tmp);
-                        GOTO(out, 0);
-                }
+               } else if ((class_match_param(lustre_cfg_string(lcfg, 1),
+                                             PARAM_SYS, &tmp) == 0)) {
+                       /* Global param settings */
+                       err = class_set_global(tmp, lcfg->lcfg_num);
+                       /*
+                        * Client or server should not fail to mount if
+                        * it hits an unknown configuration parameter.
+                        */
+                       if (err != 0)
+                               CWARN("Ignoring unknown param %s\n", tmp);
+
+                       GOTO(out, err = 0);
+               }
 
                 /* Fall through */
                 break;