From 3f2b6d2a7c4ab0bfcca0bcbb914ed3fdff1b1e32 Mon Sep 17 00:00:00 2001 From: Sonia Sharma Date: Sun, 11 Feb 2018 10:02:18 -0800 Subject: [PATCH] LU-10654 lnet: lnetctl doesn't error out on mistyped options Running lnetctl command to add/delete peer/net/route should error out with mistyped options. This patch add the changes in lnetctl.c to make lnetctl error out withmistyped options. Change-Id: Ib8ae54bea919d6ff235b4ca3a23807a809f8962c Test-Parameters: trivial Signed-off-by: Sonia Sharma Reviewed-on: https://review.whamcloud.com/31265 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin --- lnet/utils/lnetctl.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lnet/utils/lnetctl.c b/lnet/utils/lnetctl.c index e6975af..16801ef 100644 --- a/lnet/utils/lnetctl.c +++ b/lnet/utils/lnetctl.c @@ -685,6 +685,8 @@ static int jt_add_route(int argc, char **argv) continue; } break; + case '?': + print_help(route_cmds, "route", "add"); default: return 0; } @@ -786,6 +788,8 @@ static int jt_add_ni(int argc, char **argv) strlen(optarg), 0, UINT_MAX, &global_cpts); break; + case '?': + print_help(net_cmds, "net", "add"); default: return 0; } @@ -841,6 +845,8 @@ static int jt_del_route(int argc, char **argv) case 'g': gateway = optarg; break; + case '?': + print_help(route_cmds, "route", "del"); default: return 0; } @@ -889,6 +895,8 @@ static int jt_del_ni(int argc, char **argv) goto out; } break; + case '?': + print_help(net_cmds, "net", "del"); default: return 0; } @@ -953,6 +961,8 @@ static int jt_show_route(int argc, char **argv) case 'v': detail = 1; break; + case '?': + print_help(route_cmds, "route", "show"); default: return 0; } @@ -1101,6 +1111,8 @@ static int jt_show_net(int argc, char **argv) detail = 1; } break; + case '?': + print_help(net_cmds, "net", "show"); default: return 0; } @@ -1568,6 +1580,8 @@ static int jt_add_peer_nid(int argc, char **argv) case 'm': non_mr = true; break; + case '?': + print_help(peer_cmds, "peer", "add"); default: return 0; } @@ -1655,6 +1669,8 @@ static int jt_del_peer_nid(int argc, char **argv) nids = nids2; rc = LUSTRE_CFG_RC_OUT_OF_MEM; break; + case '?': + print_help(peer_cmds, "peer", "del"); default: return 0; } @@ -1718,6 +1734,8 @@ static int jt_show_peer(int argc, char **argv) detail = 1; } break; + case '?': + print_help(peer_cmds, "peer", "show"); default: return 0; } -- 1.8.3.1