[lustre-devel] [PATCH 23/25] lustre: lnd: pending transmits dropped silently

James Simmons jsimmons at infradead.org
Tue Sep 25 19:48:15 PDT 2018


From: Amir Shehata <ashehata at whamcloud.com>

list_add was being used erroneously. The logic should be to move
the txs on ibp_tx_queue on a local list which is then processed.
The code, however, did the reverse, which would result in the
pending txs not processed and thus dropped silently. This in turn
would lead to peers reference counts at the LNet layer not
decremented since lnet_finalize() might not be called for a message.

Initialize local list and use list_splice_init() to move
transmits on the ibp_tx_queue to the local list.

Signed-off-by: Amir Shehata <ashehata at whamcloud.com>
WC-bug-id: https://jira.whamcloud.com/browse/LU-10682
Reviewed-on: https://review.whamcloud.com/31374
Reviewed-by: Doug Oucharek <dougso at me.com>
Reviewed-by: Sonia Sharma <sharmaso at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 346d368..f2a01eb 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -2150,8 +2150,8 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
 	}
 
 	/* grab pending txs while I have the lock */
-	list_add(&txs, &peer_ni->ibp_tx_queue);
-	list_del_init(&peer_ni->ibp_tx_queue);
+	INIT_LIST_HEAD(&txs);
+	list_splice_init(&peer_ni->ibp_tx_queue, &txs);
 
 	if (!kiblnd_peer_active(peer_ni) ||	/* peer_ni has been deleted */
 	    conn->ibc_comms_error) {       /* error has happened already */
-- 
1.8.3.1



More information about the lustre-devel mailing list