From e19df0232f93fd044e0863b66f33eea609e37674 Mon Sep 17 00:00:00 2001 From: Maxim Patlasov Date: Thu, 25 Feb 2010 15:39:51 +0300 Subject: [PATCH] b=21911 fix for double release of ibc_lock in o2iblnd i=liang Re-acquire ibc_lock in kiblnd_post_tx_locked(). Add extra reference to conn before calling kiblnd_post_tx_locked() to avoid scenario when conn disappears inside kiblnd_post_tx_locked(). --- lnet/klnds/o2iblnd/o2iblnd_cb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c index e7444cd..638ffc5 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -871,6 +871,9 @@ kiblnd_post_tx_locked (kib_conn_t *conn, kib_tx_t *tx, int credit) if (done) kiblnd_tx_done(peer->ibp_ni, tx); + + spin_lock(&conn->ibc_lock); + return -EIO; } @@ -916,6 +919,8 @@ kiblnd_check_sends (kib_conn_t *conn) kiblnd_queue_tx_locked(tx, conn); } + kiblnd_conn_addref(conn); /* 1 ref for me.... (see b21911) */ + for (;;) { int credit; @@ -935,6 +940,8 @@ kiblnd_check_sends (kib_conn_t *conn) } spin_unlock(&conn->ibc_lock); + + kiblnd_conn_decref(conn); /* ...until here */ } void -- 1.8.3.1