Whamcloud - gitweb
LU-10391 lnet: use lnet_ni_get_status_locked for lnet_net_show_dump 16/53016/2
authorJames Simmons <jsimmons@infradead.org>
Tue, 7 Nov 2023 15:57:46 +0000 (10:57 -0500)
committerOleg Drokin <green@whamcloud.com>
Sat, 18 Nov 2023 21:42:14 +0000 (21:42 +0000)
In my testing of IPv6 I was always seeing the NI state as "down".
This is incorrect and I found this was due to reading ni->ni_status
directly. Using lnet_ni_get_status_locked() fixes the issue.

Test-Parameters: trivial testlist=sanity-lnet
Fixes: 8f8f6e2f36e ("LU-10003 lnet: use Netlink to support old and new NI APIs.")
Change-Id: I490144ceae4a5c1cdd7c920661f8220033df8cd5
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53016
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/api-ni.c

index 1ab0ad1..4bc70c6 100644 (file)
@@ -5294,7 +5294,7 @@ static int lnet_net_show_dump(struct sk_buff *msg,
                        nla_put_string(msg, LNET_NET_LOCAL_NI_ATTR_NID,
                                       libcfs_nidstr(&ni->ni_nid));
                        if (!nid_is_lo0(&ni->ni_nid) &&
-                           *ni->ni_status != LNET_NI_STATUS_UP)
+                           lnet_ni_get_status_locked(ni) != LNET_NI_STATUS_UP)
                                status = "down";
                        nla_put_string(msg, LNET_NET_LOCAL_NI_ATTR_STATUS,
                                       status);