Whamcloud - gitweb
EX-7251 lnet: fix locking multiple NIDs of the MR peer
authorSerguei Smirnov <ssmirnov@whamcloud.com>
Tue, 4 Apr 2023 21:02:51 +0000 (14:02 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 5 Apr 2023 20:17:21 +0000 (20:17 +0000)
commit1a2db3e14b7886f6207fd17bc8ab0d1142535709
treedbe28150a6907ea217cb8a25536b9e2098aa77f1
parentdb09096ac9e43fc4fcacb1ca7980e1b41406858f
EX-7251 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.

Lustre-change: https://review.whamcloud.com/50530
Lustre-commit: TBD (47df7c726987d49e92b7145c128414daa413835f)

Fixes: aacb16191a ("LU-14668 lnet: Lock primary NID logic")
Signed-off-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Change-Id: Iec9f8b70053fe24cddee552358500dfad0234b7f
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/50533
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Shuichi Ihara <sihara@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
lnet/include/lnet/lib-types.h
lnet/lnet/peer.c