Whamcloud - gitweb
LU-16709 lnet: fix locking multiple NIDs of the MR peer 30/50530/3
authorSerguei Smirnov <ssmirnov@whamcloud.com>
Tue, 4 Apr 2023 21:02:51 +0000 (14:02 -0700)
committerSerguei Smirnov <ssmirnov@whamcloud.com>
Tue, 4 Apr 2023 21:28:04 +0000 (14:28 -0700)
commit47df7c726987d49e92b7145c128414daa413835f
tree0580775b78f0378c3e70f6f4e696d7bdb550260d
parent869dae0f37ce0f6999b1a6348c8e594b53ba56d9
LU-16709 lnet: fix locking multiple NIDs of the MR peer

If LNetPrimaryNID is called on multiple NIDs of the same node,
as a result of peer discovery it is possible that
the discovered peer is found to contain a NID which is locked
as primary by a different existing peer record.
In this case it is safe to delete one of the peer records,
but the NID which got locked the earliest should be
kept as primary.

This allows for the first NID listed in the mount command's
comma-separated list to stay primary as intended
for the purpose of communicating with Lustre even if peer
discovery succeeded using a different NID of MR peer.

Fixes: aacb16191a ("LU-14668 lnet: Lock primary NID logic")
Signed-off-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Change-Id: Iec9f8b70053fe24cddee552358500dfad0234b7f
lnet/include/lnet/lib-types.h
lnet/lnet/peer.c