From a83c820f89b3bd56dc1951e62431b8e2ba8181f6 Mon Sep 17 00:00:00 2001 From: Amir Shehata Date: Tue, 14 Apr 2020 17:44:46 -0700 Subject: [PATCH] LU-12312 lnet: handle no discovery flag When a peer is being discovered, it could indicate that its discovery is disabled. In this case we shouldn't flag the peer for deletion. This operation is reserved for cases when the peer initiates a push to tell us that it has changed its status from discovery to no discovery. Fixes: 4577410165 ("LU-13028 lnet: advertise discovery when toggled") Signed-off-by: Amir Shehata Change-Id: I1d357555e234d828ba19b72fab1d041f93af548e Reviewed-on: https://review.whamcloud.com/38229 Tested-by: jenkins Reviewed-by: Serguei Smirnov Tested-by: Maloo Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- lnet/lnet/peer.c | 10 ++-------- lustre/tests/sanity-sec.sh | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c index f4c45ed..37a76c8 100644 --- a/lnet/lnet/peer.c +++ b/lnet/lnet/peer.c @@ -2032,7 +2032,8 @@ void lnet_peer_push_event(struct lnet_event *ev) * discovery disabled, we need to reflect that in our * representation of the peer. */ - if (!(lp->lp_state & LNET_PEER_NO_DISCOVERY)) + if (!(lp->lp_state & (LNET_PEER_NO_DISCOVERY | + LNET_PEER_DISCOVERING))) lp->lp_state |= LNET_PEER_MARK_DELETION; lp->lp_state |= LNET_PEER_NO_DISCOVERY; } else if (lp->lp_state & LNET_PEER_NO_DISCOVERY) { @@ -2331,13 +2332,6 @@ lnet_discovery_event_reply(struct lnet_peer *lp, struct lnet_event *ev) } else { CDEBUG(D_NET, "Peer %s has discovery disabled\n", libcfs_nid2str(lp->lp_primary_nid)); - /* - * If the peer is going from discovery enabled to - * discovery disabled, we need to reflect that in our - * representation of the peer. - */ - if (!(lp->lp_state & LNET_PEER_NO_DISCOVERY)) - lp->lp_state |= LNET_PEER_MARK_DELETION; lp->lp_state |= LNET_PEER_NO_DISCOVERY; } diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index f93895a..1999151 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -15,8 +15,8 @@ init_test_env $@ init_logging ALWAYS_EXCEPT="$SANITY_SEC_EXCEPT " -# bug number for skipped test: LU-12312 -ALWAYS_EXCEPT+=" 31" +# bug number for skipped test: +ALWAYS_EXCEPT+=" " # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! [ "$SLOW" = "no" ] && EXCEPT_SLOW="26" -- 1.8.3.1