summaryrefslogtreecommitdiffstats
path: root/net/rds/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rds/connection.c')
-rw-r--r--net/rds/connection.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c
index 7e4e9dfdbc0b..9c249f394f29 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -148,6 +148,7 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr,
spin_lock_init(&conn->c_send_lock);
atomic_set(&conn->c_send_generation, 1);
+ atomic_set(&conn->c_senders, 0);
INIT_LIST_HEAD(&conn->c_send_queue);
INIT_LIST_HEAD(&conn->c_retrans);
@@ -276,6 +277,12 @@ void rds_conn_shutdown(struct rds_connection *conn)
spin_lock_irq(&conn->c_send_lock);
spin_unlock_irq(&conn->c_send_lock);
+ while(atomic_read(&conn->c_senders)) {
+ schedule_timeout(1);
+ spin_lock_irq(&conn->c_send_lock);
+ spin_unlock_irq(&conn->c_send_lock);
+ }
+
conn->c_trans->conn_shutdown(conn);
rds_conn_reset(conn);