Whamcloud - gitweb
LU-10391 lnet: Ping target corrupted 20/53320/3
authorChris Horn <chris.horn@hpe.com>
Mon, 4 Dec 2023 21:14:53 +0000 (15:14 -0600)
committerOleg Drokin <green@whamcloud.com>
Wed, 20 Dec 2023 01:44:25 +0000 (01:44 +0000)
If NIs with large NIDs are added then the discovery ping target
can become corrupted. This is due to a typo in
len_ping_target_install_locked(). Instead of writing the NI status to
the lnet_ni_large_status::ns_status field, we were instead writing the
status value 8 bytes into the lnet_ni_large_status (ns_status is
offset 8 into lnet_ni_status). This overwrites some of the struct
lnet_nid.

Test-Parameters: trivial
Fixes: db0fb8f ("LU-10391 lnet: allow ping packet to contain large nids")
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: I7ccff7ae59feac5edc6a97a86c861ffbdb0bb333
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53320
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lnet/lnet/api-ni.c

index 99d38b0..4185a90 100644 (file)
@@ -2073,7 +2073,7 @@ lnet_ping_target_install_locked(struct lnet_ping_buffer *pbuf)
                        lns->ns_nid = ni->ni_nid;
 
                        lnet_ni_lock(ni);
-                       ns->ns_status = lnet_ni_get_status_locked(ni);
+                       lns->ns_status = lnet_ni_get_status_locked(ni);
                        ni->ni_status = &lns->ns_status;
                        lnet_ni_unlock(ni);