test_123ad() { # LU-11566
remote_mgs_nodsh && skip "remote MGS with nodsh"
+ if (( $MDS1_VERSION >= $(version_code 2.16.50) )); then
+ llog_info="llog info"
+ llog_print="llog print"
+ else
+ llog_info="llog_info"
+ llog_print="llog_print"
+ fi
# older versions of lctl may not print all records properly
(( MGS_VERSION >= $(version_code 2.15.90) )) ||
skip "Need MGS version at least 2.15.90"
# flags: 4 (plain)
# records_count: 72
# last_index: 72
- local num=$(do_facet mgs $LCTL --device MGS llog_info $FSNAME-client |
+ local num=$(do_facet mgs $LCTL --device MGS $llog_info $FSNAME-client |
awk '/last_index:/ { print $2 }')
- do_facet mgs $LCTL --device MGS llog_print $FSNAME-client |
+ do_facet mgs $LCTL --device MGS $llog_print $FSNAME-client |
grep -q "$FSNAME-OST0000.*osc\.max_dirty_mb=$old" ||
error "ocs.max_dirty_mb=$old not found in $FSNAME-client"
# - { index: 72, event: marker, flags: 0x06, ... }
- local last=$(do_facet mgs $LCTL --device MGS llog_print -r $FSNAME-client |
+ local last=$(do_facet mgs $LCTL --device MGS $llog_print -r $FSNAME-client |
tail -1 | awk '{ print $4 }' | tr -d , )
- (( last == num )) || error "llog_print only showed $last/$num records"
+ (( last == num )) || error "$llog_print only showed $last/$num records"
}
run_test 123ad "llog_print shows all records"
JT_SUBCMD(snapshot);
/**
+ * command_t llog_cmdlist - lctl llog commands.
+ */
+command_t llog_cmdlist[] = {
+ { .pc_name = "catlist", .pc_func = jt_llog_catlist,
+ .pc_help = "list Lustre configuration log files\n"
+ "usage: llog catlist"},
+ { .pc_name = "info", .pc_func = jt_llog_info,
+ .pc_help = "print log header information\n"
+ "usage: llog info {LOGNAME|FID}"},
+ { .pc_name = "print", .pc_func = jt_llog_print,
+ .pc_help = "print the content of a configuration log\n"
+ "usage: llog print {LOGNAME|FID} [--start INDEX] [--end INDEX]\n"
+ " [--raw]"},
+ { .pc_name = "cancel", .pc_func = jt_llog_cancel,
+ .pc_help = "cancel one record in specified log.\n"
+ "usage:llog cancel {LOGNAME|FID} --log_idx INDEX"},
+ { .pc_name = "check", .pc_func = jt_llog_check,
+ .pc_help = "verify that log content is valid.\n"
+ "usage: llog_check {LOGNAME|FID} [--start INDEX] [--end INDEX]\n"
+ " check all records from index 1 by default."},
+ { .pc_name = "remove", .pc_func = jt_llog_check,
+ .pc_help = "remove one log and erase it from disk.\n"
+ "usage: llog remove {LOGNAME|FID} [--log_id ID]"},
+ { .pc_help = NULL }
+};
+JT_SUBCMD(llog);
+
+/**
* command_t lfsck_cmdlist - lctl lfsck commands.
*/
command_t lfsck_cmdlist[] = {
"usage: llog_catlist"},
{"llog_info", jt_llog_info, 0,
"print log header information.\n"
- "usage: llog_info {LOGNAME|FID}\n"},
+ "usage: llog_info {LOGNAME|FID}"},
{"llog_print", jt_llog_print, 0,
"print all effective log records by default, or within given range.\n"
"With --raw option skipped records are printed as well.\n"
"usage: llog_print {LOGNAME|FID} [--start INDEX] [--end INDEX]\n"
- " [--raw]\n"},
+ " [--raw]"},
{"llog_cancel", jt_llog_cancel, 0,
"cancel one record in specified log.\n"
- "usage:llog_cancel {LOGNAME|FID} --log_idx INDEX\n"},
+ "usage:llog_cancel {LOGNAME|FID} --log_idx INDEX"},
{"llog_check", jt_llog_check, 0,
"verify that log content is valid.\n"
"usage: llog_check {LOGNAME|FID} [--start INDEX] [--end INDEX]\n"
{"llog_remove", jt_llog_remove, 0,
"remove one log from catalog or plain log, erase it from disk.\n"
"usage: llog_remove {LOGNAME|FID} [--log_id ID]"},
+ {"llog", jt_llog, llog_cmdlist, ""},
+
{"lcfg_clear", jt_lcfg_clear, 0,
"drop unused config llog records for a device or filesystem.\n"
"clients and servers must be unmounted during this operation.\n"