From 23b26e90a343ecff14c67dea1bafb65e23473cd6 Mon Sep 17 00:00:00 2001 From: LiuYing Date: Wed, 2 Jun 2010 18:24:34 +0800 Subject: [PATCH] b=22455 fix the problem in get_param with option "-N" -set flag recursive=0 when we get param with option "-N" -use operator "=" to set param with negative value i=adilger i=rread --- lustre/tests/test-framework.sh | 2 +- lustre/utils/lctl.c | 2 +- lustre/utils/lustre_cfg.c | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 97bdb60..900f93f 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1750,7 +1750,7 @@ switch_identity() { do_facet mds$num "lctl set_param -n mdt.$MDT.identity_upcall \"NONE\"" fi - do_facet mds$num "lctl set_param -n mdt/$MDT/identity_flush \"-1\"" + do_facet mds$num "lctl set_param -n mdt/$MDT/identity_flush=-1" if [ $old = "NONE" ]; then return 1 diff --git a/lustre/utils/lctl.c b/lustre/utils/lctl.c index 369dab4..cd22582 100644 --- a/lustre/utils/lctl.c +++ b/lustre/utils/lctl.c @@ -147,7 +147,7 @@ command_t cmdlist[] = { " -F When -N specified, add '/', '@' or '=' for directories,\n" " symlinks and writeable files, respectively."}, {"set_param", jt_lcfg_setparam, 0, "set the Lustre or LNET parameter\n" - "usage: set_param [-n] \n" + "usage: set_param [-n] \n" "Set the value of the Lustre or LNET parameter at the specified path\n" " -n Disable printing of the key name when printing values."}, {"list_param", jt_lcfg_listparam, 0, diff --git a/lustre/utils/lustre_cfg.c b/lustre/utils/lustre_cfg.c index 4b527d0..9079242 100644 --- a/lustre/utils/lustre_cfg.c +++ b/lustre/utils/lustre_cfg.c @@ -647,10 +647,10 @@ static void clean_path(char *path) } struct param_opts { - int only_path; - int show_path; - int show_type; - int recursive; + int only_path:1; + int show_path:1; + int show_type:1; + int recursive:1; }; static int listparam_cmdline(int argc, char **argv, struct param_opts *popt) @@ -766,6 +766,7 @@ static int getparam_cmdline(int argc, char **argv, struct param_opts *popt) popt->show_path = 1; popt->only_path = 0; popt->show_type = 0; + popt->recursive = 0; while ((ch = getopt(argc, argv, "nNF")) != -1) { switch (ch) { @@ -905,6 +906,7 @@ static int setparam_cmdline(int argc, char **argv, struct param_opts *popt) popt->show_path = 1; popt->only_path = 0; popt->show_type = 0; + popt->recursive = 0; while ((ch = getopt(argc, argv, "n")) != -1) { switch (ch) { -- 1.8.3.1