From: James Simmons Date: Sat, 29 Sep 2018 23:53:33 +0100 (BST) Subject: [lustre-devel] [PATCH 07/34] lnet: lnet_peer_tables_cleanup: use an exclusive lock. In-Reply-To: <153783763511.32103.5073326313518943569.stgit@noble> References: <153783752960.32103.8394391715843917125.stgit@noble> <153783763511.32103.5073326313518943569.stgit@noble> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lustre-devel@lists.lustre.org > Why?? surely this will deadlock. > > This is part of > Commit: 58091af960fe ("LU-7734 lnet: Multi-Rail peer split") > from upstream lustre, where it is marked: > Signed-off-by: Amir Shehata > WC-bug-id: https://jira.whamcloud.com/browse/LU-7734 > Reviewed-on: http://review.whamcloud.com/18293 > Reviewed-by: Olaf Weber > Reviewed-by: Doug Oucharek The code is right but the commit message needs a update. Olaf, Doug, or Amir can you fill in the gaps. Reviewed-by: James Simmons P.S Its strange that git is not sending message to the people in the Reviewed-by:. Maybe git can't handle the indent? > Signed-off-by: NeilBrown > --- > drivers/staging/lustre/lnet/lnet/peer.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/lustre/lnet/lnet/peer.c b/drivers/staging/lustre/lnet/lnet/peer.c > index 53b0ca0a2021..376e3459fa92 100644 > --- a/drivers/staging/lustre/lnet/lnet/peer.c > +++ b/drivers/staging/lustre/lnet/lnet/peer.c > @@ -185,9 +185,9 @@ lnet_peer_tables_cleanup(struct lnet_ni *ni) > * peers are gateways for. > */ > cfs_percpt_for_each(ptable, i, the_lnet.ln_peer_tables) { > - lnet_net_lock(i); > + lnet_net_lock(LNET_LOCK_EX); > lnet_peer_table_del_rtrs_locked(ni, ptable, i); > - lnet_net_unlock(i); > + lnet_net_unlock(LNET_LOCK_EX); > } > > /* > @@ -195,17 +195,17 @@ lnet_peer_tables_cleanup(struct lnet_ni *ni) > * deathrow. > */ > cfs_percpt_for_each(ptable, i, the_lnet.ln_peer_tables) { > - lnet_net_lock(i); > + lnet_net_lock(LNET_LOCK_EX); > lnet_peer_table_cleanup_locked(ni, ptable); > - lnet_net_unlock(i); > + lnet_net_unlock(LNET_LOCK_EX); > } > > /* Cleanup all entries on deathrow. */ > cfs_percpt_for_each(ptable, i, the_lnet.ln_peer_tables) { > - lnet_net_lock(i); > + lnet_net_lock(LNET_LOCK_EX); > lnet_peer_table_deathrow_wait_locked(ptable, i); > list_splice_init(&ptable->pt_deathrow, &deathrow); > - lnet_net_unlock(i); > + lnet_net_unlock(LNET_LOCK_EX); > } > > while (!list_empty(&deathrow)) { > > >