Whamcloud - gitweb
LU-17000 coverity: Fix Logically dead code under lnetctl.c 21/52921/6
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Wed, 1 Nov 2023 10:44:08 +0000 (16:14 +0530)
committerOleg Drokin <green@whamcloud.com>
Sat, 18 Nov 2023 21:46:39 +0000 (21:46 +0000)
This patch fixes Logically dead code reported by
coverity run. This uncovers the missing call
to lustre_lnet_list_peer() to list peer under
old API.

CoverityID: 404746 ("Logically dead code")

Test-Parameters: trivial testlist=sanity-lnet
Fixes: f0be00678c ("LU-9680 lnet: collect data about peer_ni by using Netlink")
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I0659ce403110118697fb8c88ade70f1695509382
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52921
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/utils/lnetctl.c

index 2fe2347..9980529 100644 (file)
@@ -4102,8 +4102,8 @@ old_api:
 
 static int jt_list_peer(int argc, char **argv)
 {
-       int rc;
        struct cYAML *err_rc = NULL, *list_rc = NULL;
+       int rc;
 
        rc = check_cmd(peer_cmds, "peer", "list", 0, argc, argv);
        if (rc)
@@ -4115,7 +4115,9 @@ static int jt_list_peer(int argc, char **argv)
                        goto old_api;
                return rc;
        }
+
 old_api:
+       rc = lustre_lnet_list_peer(-1, &list_rc, &err_rc);
        if (rc != LUSTRE_CFG_RC_NO_ERR)
                cYAML_print_tree2file(stderr, err_rc);
        else if (list_rc)