From 6d475522a3b84d16457aa0f2eaaf5bbcc021aa41 Mon Sep 17 00:00:00 2001 From: liangzhen Date: Fri, 28 Mar 2008 07:12:34 +0000 Subject: [PATCH] Branch HEAD b=15335 i=isaac Release pending txs before shutdown connection and destroy peer. --- lnet/klnds/o2iblnd/o2iblnd_cb.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c index 3b7d6c6..dfe6919 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -2129,7 +2129,7 @@ kiblnd_connreq_done(kib_conn_t *conn, int status) if (status != 0) { /* failed to establish connection */ - kiblnd_peer_connect_failed(conn->ibc_peer, active, status); + kiblnd_peer_connect_failed(peer, active, status); kiblnd_finalise_conn(conn); return; } @@ -2150,22 +2150,25 @@ kiblnd_connreq_done(kib_conn_t *conn, int status) else peer->ibp_accepting--; - kiblnd_close_stale_conns_locked(conn->ibc_peer, - conn->ibc_incarnation); + kiblnd_close_stale_conns_locked(peer, conn->ibc_incarnation); + + /* grab pending txs while I have the lock */ + list_add(&txs, &peer->ibp_tx_queue); + list_del_init(&peer->ibp_tx_queue); if (!kiblnd_peer_active(peer) || /* peer has been deleted */ conn->ibc_comms_error != 0) { /* error has happened already */ + lnet_ni_t *ni = peer->ibp_ni; /* start to shut down connection */ kiblnd_close_conn_locked(conn, -ECONNABORTED); write_unlock_irqrestore(&kiblnd_data.kib_global_lock, flags); + + kiblnd_txlist_done(ni, &txs, -ECONNABORTED); + return; } - /* grab pending txs while I have the lock */ - list_add(&txs, &peer->ibp_tx_queue); - list_del_init(&peer->ibp_tx_queue); - write_unlock_irqrestore(&kiblnd_data.kib_global_lock, flags); /* Schedule blocked txs */ -- 1.8.3.1