Whamcloud - gitweb
LU-14655 lnet: Protect lpni deref in lnet_health_check 03/43503/3
authorChris Horn <chris.horn@hpe.com>
Wed, 28 Apr 2021 01:10:16 +0000 (20:10 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 27 Jul 2021 21:35:58 +0000 (21:35 +0000)
commitd87af24452a2e883b0e7400661a5b768c35088b1
tree6bdaaaff9ff74e280404dbad151f5e8ae70b38a2
parent233344d451e567c71726bcb071f45cf8f1c6ef3e
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.

HPE-bug-id: LUS-9962
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: I3e6763b71bcdc9281f46b79c59e40f939190d468
Reviewed-on: https://review.whamcloud.com/43503
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/lib-msg.c