Whamcloud - gitweb
LU-17914 lnet: Fix erroneous net set error 44/55344/2
authorChris Horn <chris.horn@hpe.com>
Thu, 6 Jun 2024 21:43:09 +0000 (15:43 -0600)
committerOleg Drokin <green@whamcloud.com>
Wed, 19 Jun 2024 01:17:19 +0000 (01:17 +0000)
lnetctl net set --health command reports a false error. This is
because in lnet_genl_parse_local_ni() the last value stored in rc is
from nla_strscpy() which can return a positive value.

Test-Parameters: trivial testlist=sanity-lnet
Fixes: fff650726b ("LU-13642 lnet: Allow dynamic IP specification")
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: I86211a1083af4b225076f966d2e0c7793589a33a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55344
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/api-ni.c
lustre/tests/sanity-lnet.sh

index 605111a..fadf9d4 100644 (file)
@@ -6249,6 +6249,7 @@ lnet_genl_parse_local_ni(struct nlattr *entry, struct genl_info *info,
                }
        } else if (info->nlhdr->nlmsg_flags & NLM_F_REPLACE && healthv != -1) {
                lnet_ni_set_healthv(&nid, healthv);
+               rc = 0;
        } else if (!(info->nlhdr->nlmsg_flags & (NLM_F_CREATE | NLM_F_REPLACE))) {
                struct lnet_ni *ni;
 
index 9d91754..546c562 100755 (executable)
@@ -1888,8 +1888,10 @@ function lnet_health_post() {
 
        restore_lnet_params
 
-       do_lnetctl peer set --health 1000 --all
-       do_lnetctl net set --health 1000 --all
+       do_lnetctl peer set --health 1000 --all ||
+               error "Failed to set peer health rc $?"
+       do_lnetctl net set --health 1000 --all ||
+               error "Failed to set local NI health rc $?"
 
        return 0
 }
@@ -2445,7 +2447,8 @@ test_210() {
                error "Failed to add drop rule"
        $LCTL net_drop_add -s *@${NETTYPE}1 -d *@${NETTYPE}1 -r 1 ||
                error "Failed to add drop rule"
-       do_lnetctl net set --health 0 --nid $prim_nid
+       do_lnetctl net set --health 0 --nid $prim_nid ||
+               error "Failed to set NI health to 0 rc $?"
 
        check_ping_count "ni" "$prim_nid" "2" "10"
        check_nid_in_recovq "-l" "$prim_nid" "1"
@@ -2483,7 +2486,8 @@ test_210() {
                error "Failed to add drop rule"
        $LCTL net_drop_add -s *@${NETTYPE}1 -d *@${NETTYPE}1 -r 1 ||
                error "Failed to add drop rule"
-       do_lnetctl net set --health 0 --nid $prim_nid
+       do_lnetctl net set --health 0 --nid $prim_nid ||
+               error "Failed to set NI health to 0 rc $?"
 
        check_ping_count "ni" "$prim_nid" "2" "10"
        check_nid_in_recovq "-l" "$prim_nid" "1"