Whamcloud - gitweb
LU-2309 config: ignore unknown configuration param
authorJian Yu <jian.yu@intel.com>
Mon, 8 Apr 2013 09:56:49 +0000 (17:56 +0800)
committerJohann Lombardi <johann.lombardi@intel.com>
Wed, 17 Apr 2013 21:24:25 +0000 (17:24 -0400)
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.

The patch also improves conf-sanity test 42 to verify
that invalid sys config param should not prevent client
or server from mounting.

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I04b7a0fe90a558b41c68b6e1218823db1ceed8b4
Reviewed-on: http://review.whamcloud.com/5972
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
lustre/obdclass/obd_config.c
lustre/tests/conf-sanity.sh

index a3af94d..ab382db 100644 (file)
@@ -869,11 +869,14 @@ int class_process_config(struct lustre_cfg *lcfg)
                                               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)
+                        /*
+                         * 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, 0);
+
+                        GOTO(out, err = 0);
                 }
 
                 /* Fall through */
index 7577b1e..cfc2f0e 100644 (file)
@@ -1788,14 +1788,22 @@ run_test 41 "mount mds with --nosvc and --nomgs"
 
 test_42() { #bug 14693
         setup
-        check_mount || return 2
-        do_facet client lctl conf_param lustre.llite.some_wrong_param=10
-        umount_client $MOUNT
-        mount_client $MOUNT || return 1
-        cleanup
+        check_mount || error "client was not mounted"
+
+        do_facet mgs $LCTL conf_param $FSNAME.llite.some_wrong_param=10
+        umount_client $MOUNT ||
+                error "unmounting client failed with invalid llite param"
+        mount_client $MOUNT ||
+                error "mounting client failed with invalid llite param"
+
+        do_facet mgs $LCTL conf_param $FSNAME.sys.some_wrong_param=20
+               cleanup || error "stopping $FSNAME failed with invalid sys param"
+        setup
+        check_mount || "client was not mounted with invalid sys param"
+        cleanup || error "stopping $FSNAME failed with invalid sys param"
         return 0
 }
-run_test 42 "invalid config param should not prevent client from mounting"
+run_test 42 "allow client/server mount/unmount with invalid config param"
 
 test_43() { #bug 15993
         setup