# This is the per-client lustre configuration file.
-# The parameters declared in this file will be set after the system has mounted,
-# but only on this node.
+# The parameters declared in this file will be set after
+# the system has mounted, but only on this node.
+# Parameters for ALL clients should use "lctl set_param -P".
-# if mount.$FS_NAME.params exists, the parameters declared in
+# If mount.$FS_NAME.params exists, the parameters declared in
# that file will be loaded afterwards, meaning the filesystem
# specific parameters will override the client specific ones.
# Examples:
-# max_dirty_mb=7873
+# osc.*.max_dirty_mb=7873
# mdc.*.max_rpcs_in_flight=16
# jobid_var=nodelocal
# jobid_name=%H:%e:%u
\ No newline at end of file
.RB [ --no-links | -L ]
.RB [ --no-name | -n ]
.RB [ --only-name | -N ]
+.RB [ --readable | -r ]
.RB [ --recursive | -R ]
+.RB [ --writable | -w ]
.RB [ --yaml | -y ]
.IR PARAM_PATH1 " [" PARAM_PATH2 " ...]"
.YS
useful when using patterns. This option is equivalent to
.BR "lctl list_param".
.TP
+.BR -r ", " --readable
+Print only parameters that are have read permission. Can be used with
+.RB [ -w | --writable ]
+to print parameters that are both readable and writable.
+.TP
.BR -R ", " --recursive
Recursively show all of the parameter names below the specified name.
.TP
+.BR -w ", " --writable
+Print only parameters that are have write permission. Can be used with
+.RB [ -r | --readable ]
+to print parameters that are both readable and writable.
+.TP
.BR -y ", " --yaml
Some paramters can be presented in a YAML format but are not by default. This
will format the parameter data in YAML. If the YAML provides a source: field
.RB [ --links | -l ]
.RB [ --no-links | -L ]
.RB [ --path | -p ]
+.RB [ --readable | -r ]
.RB [ --recursive | -R ]
+.RB [ --writeable | -w ]
.IR PARAM_PATH1 " [" PARAM_PATH2 " ...]"
.YS
.SH DESCRIPTION
.BR -p ", " --path
Print the path name instead of the parameter name.
.TP
+.BR -r ", " --readable
+Print only parameters that have read permission. Can be used with
+.RB [ -w | --writable ]
+to print parameters that are both readable and writable.
+.TP
.BR -R ", " --recursive
Recursively list all parameters under the specified parameter search string. If
.I param_search
is unspecified, all the parameters will be shown.
+.TP
+.BR -w ", " --writable
+Print only parameters that have write permission. Can be used with
+.RB [ -r | --readable ]
+to print parameters that are both readable and writable.
.SH EXAMPLES
Use wildcards to obtain all matching parameters:
.RS
}
run_test 401aa "Verify that 'lctl list_param -p' lists the correct path names"
+test_401ab() {
+ $LCTL list_param -pr "*" | while read path; do
+ [[ -r $path ]] || error "'$path' not readable"
+ done
+
+ $LCTL list_param -pLr "*" | while read path; do
+ [[ -r $path ]] || error "'$path' not readable (--no-links)"
+ done
+}
+run_test 401ab "Check that 'lctl list_param -r' lists only readable params"
+
+test_401ac() {
+ $LCTL list_param -pw "*" | while read path; do
+ [[ -w $path ]] || error "'$path' not writable"
+ done
+
+ $LCTL list_param -pLw "*" | while read path; do
+ [[ -w $path ]] || error "'$path' not writable (--no-links)"
+ done
+}
+run_test 401ac "Check that 'lctl list_param -w' lists only writable params"
+
+test_401ad() {
+ $LCTL list_param -prw "*" | while read path; do
+ [[ -r $path && -w $path ]] ||
+ error "'$path' not readable and writable"
+ done
+
+ $LCTL list_param -pLrw "*" | while read path; do
+ [[ -r $path && -w $path ]] ||
+ error "'$path' not readable and writable (--no-links)"
+ done
+}
+run_test 401ad "Check that 'lctl list_param -wr' is conjunctive"
+
test_401b() {
# jobid_var may not allow arbitrary values, so use jobid_name
# if available
{"get_param", jt_lcfg_getparam, 0, "get the Lustre or LNET parameter\n"
"usage: get_param [--classify|-F] [--header|-H] [--links|-l]\n"
" [--no-links|-L] [--no-name|-n] [--only-name|-N]\n"
- " [--recursive|-R] [--yaml|-y]\n"
+ " [--readable|-r] [--recursive|-R]\n"
+ " [--writable|-w] [--yaml|-y]\n"
" <param_path1 param_path2 ...>\n"
"Get the value of Lustre or LNET parameter from the specified path.\n"
"The path can contain shell-style filename patterns.\n"},
{"list_param", jt_lcfg_listparam, 0,
"list the Lustre or LNET parameter name\n"
"usage: list_param [--dir-only|-D] [--classify|-F] [--links|-l]\n"
- " [--no-links|-L] [--path|-p] [--recursive|-R]\n"
+ " [--no-links|-L] [--path|-p] [--readable|-r]\n"
+ " [--recursive|-R] [--writable|-w]\n"
" <param_path1 param_path2 ...>\n"
"List the name of Lustre or LNet parameter from the specified path.\n"},
{"del_ost", jt_del_ost, 0, "permanently delete OST records\n"
unsigned int po_header:1;
unsigned int po_follow_symlinks:1;
unsigned int po_parallel_threads;
+ unsigned int po_permissions;
};
#ifdef HAVE_LIBPTHREAD
continue;
if (popt->po_only_dir && !S_ISDIR(st.st_mode))
continue;
+ if (popt->po_permissions &&
+ (st.st_mode & popt->po_permissions) != popt->po_permissions)
+ continue;
param_name = display_name(paths.gl_pathv[i], &st, popt);
if (!param_name) {
{ .val = 'F', .name = "classify", .has_arg = no_argument},
{ .val = 'l', .name = "links", .has_arg = no_argument},
{ .val = 'L', .name = "no-links", .has_arg = no_argument},
+ { .val = 'r', .name = "readable", .has_arg = no_argument},
{ .val = 'R', .name = "recursive", .has_arg = no_argument},
+ { .val = 'w', .name = "writable", .has_arg = no_argument},
};
int ch;
/* reset optind for each getopt_long() in case of multiple calls */
optind = 0;
- while ((ch = getopt_long(argc, argv, "DFlLpR",
+ while ((ch = getopt_long(argc, argv, "DFlLprRw",
long_opts, NULL)) != -1) {
switch (ch) {
case 'D':
case 'p':
popt->po_only_pathname = 1;
break;
+ case 'r':
+ popt->po_permissions |= S_IREAD;
+ break;
case 'R':
popt->po_recursive = 1;
break;
+ case 'w':
+ popt->po_recursive |= S_IWRITE;
+ break;
default:
return -1;
}
{ .val = 'L', .name = "no-links", .has_arg = no_argument},
{ .val = 'n', .name = "no-name", .has_arg = no_argument},
{ .val = 'N', .name = "only-name", .has_arg = no_argument},
+ { .val = 'r', .name = "readable", .has_arg = no_argument},
{ .val = 'R', .name = "recursive", .has_arg = no_argument},
+ { .val = 'w', .name = "writable", .has_arg = no_argument},
{ .val = 'y', .name = "yaml", .has_arg = no_argument},
};
/* reset optind for each getopt_long() in case of multiple calls */
optind = 0;
- while ((ch = getopt_long(argc, argv, "FHlLnNRy",
+ while ((ch = getopt_long(argc, argv, "FHlLnNrRwy",
long_opts, NULL)) != -1) {
switch (ch) {
case 'F':
case 'N':
popt->po_only_name = 1;
break;
+ case 'r':
+ popt->po_permissions |= S_IREAD;
+ break;
case 'R':
popt->po_recursive = 1;
break;
+ case 'w':
+ popt->po_permissions |= S_IWRITE;
+ break;
case 'y':
popt->po_yaml = 1;
break;