Whamcloud - gitweb
LU-16998 lnet: Error when missing discover arg 90/51790/2
authorChris Horn <chris.horn@hpe.com>
Tue, 9 May 2023 20:05:21 +0000 (14:05 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 24 Aug 2023 04:34:32 +0000 (04:34 +0000)
Print an error when a user does not supply a NID argument to the
'lnetctl discover' command.

Test-Parameters: trivial
HPE-bug-id: LUS-11487
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: I081137db5490547a69248b7d2e7f7986b6d8612e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51790
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/utils/lnetctl.c

index 9eb8ecc..b5d9d16 100644 (file)
@@ -3481,6 +3481,11 @@ static int jt_discover(int argc, char **argv)
                }
        }
 
+       if (optind == argc) {
+               printf("Missing nid argument\n");
+               return -1;
+       }
+
        for (; optind < argc; optind++)
                rc = lustre_lnet_discover_nid(argv[optind], force, -1, &show_rc,
                                              &err_rc);