Whamcloud - gitweb
LU-17271 kfilnd: Protect RKEY for bulk Put/Get 28/53028/3
authorChris Horn <chris.horn@hpe.com>
Tue, 7 Nov 2023 21:14:42 +0000 (14:14 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 15 Feb 2024 07:07:11 +0000 (07:07 +0000)
commitf054443e9c03b71a934fd7d05475fb55e50be8c8
treeb222a171ab7fa60a89c21808be3a3b7c6c2d1ede
parent0fbaf7ba629861c8847e607cb62aea534f8f2b0b
LU-17271 kfilnd: Protect RKEY for bulk Put/Get

The initiator of a bulk Put/Get generates an RKEY based on the the
values of the struct kfilnd_tn::tn_mr_key and
struct kfilnd_peer::kp_local_session_key. kp_local_session_key is
assigned at peer creation, and tn_mr_key is assigned when the
kfilnd_tn is allocated.

A bulk Put/Get can fail in various ways such that the target of the
operation may have a reference to the RKEY, but the originator cannot
know the state of the operation at the target. In these cases, the
initiator must ensure that the RKEY is not re-used. To accomplish
this, we need to delete the target peer from the originator's peer
cache to ensure that subsequent bulk Put/Get operations will use
a new kp_local_session_key, and thus avoid re-using any old RKEY
values.

HPE-bug-id: LUS-11972
Test-Parameters: trivial
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: If270a2df745ee88c35addc8194cdb160cb373c3e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53028
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Ron Gredvig <ron.gredvig@hpe.com>
Reviewed-by: Ian Ziemba <ian.ziemba@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/klnds/kfilnd/kfilnd_peer.c
lnet/klnds/kfilnd/kfilnd_peer.h
lnet/klnds/kfilnd/kfilnd_tn.c