aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rds/connection.c')
-rw-r--r--net/rds/connection.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c
index 968b7a798398..519b4fe962b6 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -312,6 +312,10 @@ void rds_conn_shutdown(struct rds_connection *conn)
312 312
313/* 313/*
314 * Stop and free a connection. 314 * Stop and free a connection.
315 *
316 * This can only be used in very limited circumstances. It assumes that once
317 * the conn has been shutdown that no one else is referencing the connection.
318 * We can only ensure this in the rmmod path in the current code.
315 */ 319 */
316void rds_conn_destroy(struct rds_connection *conn) 320void rds_conn_destroy(struct rds_connection *conn)
317{ 321{
@@ -326,10 +330,11 @@ void rds_conn_destroy(struct rds_connection *conn)
326 spin_lock_irq(&rds_conn_lock); 330 spin_lock_irq(&rds_conn_lock);
327 hlist_del_init_rcu(&conn->c_hash_node); 331 hlist_del_init_rcu(&conn->c_hash_node);
328 spin_unlock_irq(&rds_conn_lock); 332 spin_unlock_irq(&rds_conn_lock);
329
330 synchronize_rcu(); 333 synchronize_rcu();
331 334
332 rds_conn_shutdown(conn); 335 /* shut the connection down */
336 rds_conn_drop(conn);
337 flush_work(&conn->c_down_w);
333 338
334 /* tear down queued messages */ 339 /* tear down queued messages */
335 list_for_each_entry_safe(rm, rtmp, 340 list_for_each_entry_safe(rm, rtmp,