From: Jian Yu Date: Wed, 16 Jan 2013 06:37:35 +0000 (+0800) Subject: LU-2309 config: ignore unknown configuration param X-Git-Tag: 2.3.60~32 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=0302cc9dc33a2c8cc013bd117d5b738fe3ae1a76 LU-2309 config: ignore unknown configuration param 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 Change-Id: I33a6eb3c2beb3dd7425a097e8e7b5a2766852a96 Reviewed-on: http://review.whamcloud.com/5037 Tested-by: Hudson Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Tested-by: Maloo --- diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index d23f1b9..a9c1ceb 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -1149,11 +1149,14 @@ int class_process_config(struct lustre_cfg *lcfg) PARAM_SYS, &tmp) == 0)) { /* Global param settings */ err = class_set_global(tmp, lcfg->lcfg_num, lcfg); - /* 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); + /* + * 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); } else if ((class_match_param(lustre_cfg_string(lcfg, 1), PARAM_QUOTA, &tmp) == 0) && quota_process_config) { diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 71519de..63c9aaa4 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -2231,15 +2231,23 @@ test_41b() { run_test 41b "mount mds with --nosvc and --nomgs on first mount" test_42() { #bug 14693 - setup - check_mount || return 2 - do_facet mgs $LCTL conf_param lustre.llite.some_wrong_param=10 - umount_client $MOUNT - mount_client $MOUNT || return 1 - cleanup - return 0 + setup + 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() { [ $UID -ne 0 -o $RUNAS_ID -eq 0 ] && skip_env "run as root"