Whamcloud - gitweb
LU-15852 lnet: Don't modify uptodate peer with temp NI 22/47322/3
authorChris Horn <chris.horn@hpe.com>
Wed, 30 Mar 2022 18:35:23 +0000 (13:35 -0500)
committerOleg Drokin <green@whamcloud.com>
Wed, 2 Nov 2022 07:11:00 +0000 (07:11 +0000)
When processing the config log it is possible that we attempt to
add temp NIs after discovery has completed on a peer. These temp
may not actually exist on the peer. Since discovery has already
completed the peer is considered up-to-date and we can end up with
incorrect peer entries. We shouldn't add temp NIs to a peer that
is already up-to-date.

HPE-bug-id: LUS-10867
Test-Parameters: trivial testlist=sanity-lnet
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: Ia484713b1e6c9e1a46e525589b7c741c6478e417
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/47322
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/peer.c

index 00bbe87..7eff033 100644 (file)
@@ -1865,6 +1865,7 @@ out:
 int
 lnet_add_peer_ni(struct lnet_nid *prim_nid, struct lnet_nid *nid, bool mr,
                 bool temp)
+__must_hold(&the_lnet.ln_api_mutex)
 {
        struct lnet_peer *lp = NULL;
        struct lnet_peer_ni *lpni;
@@ -1916,6 +1917,13 @@ lnet_add_peer_ni(struct lnet_nid *prim_nid, struct lnet_nid *nid, bool mr,
                return -EPERM;
        }
 
+       if (temp && lnet_peer_is_uptodate(lp)) {
+               CDEBUG(D_NET,
+                      "Don't add temporary peer NI for uptodate peer %s\n",
+                      libcfs_nidstr(&lp->lp_primary_nid));
+               return -EINVAL;
+       }
+
        return lnet_peer_add_nid(lp, nid, flags);
 }