Whamcloud - gitweb
LU-14655 lnet: Protect lpni deref in lnet_health_check
authorChris Horn <chris.horn@hpe.com>
Wed, 28 Apr 2021 01:10:16 +0000 (20:10 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 20 Jan 2022 06:43:36 +0000 (06:43 +0000)
commit742fc12a1ed1135aca92ccba87d20649c62392af
treefee2ac0e88d1a7b6e9c234433a64ae815733f215
parent63a6f8771bac80218fbf5c251914113ff159c933
LU-14655 lnet: Protect lpni deref in lnet_health_check

Discovery thread can modify peer NI/peer net/peer relationship
so we need to be careful when dereferencing the peer NI pointer in
lnet_health_check(). Discovery thread operations under net lock, so
move the peer NI dereference under the net lock which is taken for
incrementing the health stats.

Move some of the other code that is only relevant for messages with a
health status != LNET_MSG_STATUS_OK under the appropriate condition.

Lustre-commit: d87af24452a2e883b0e7400661a5b768c35088b1
Lustre-change: https://review.whamcloud.com/43503

Test-Parameters:  testlist=sanity-lnet
HPE-bug-id: LUS-9962
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: I3e6763b71bcdc9281f46b79c59e40f939190d468
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/46138
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lnet/lnet/lib-msg.c