|author||Zach Brown <firstname.lastname@example.org>||2010-07-23 10:36:58 -0700|
|committer||Andy Grover <email@example.com>||2010-09-08 18:16:48 -0700|
|parent||RDS: have sockets get transport module references (diff)|
RDS: don't call rds_conn_shutdown() from rds_conn_destroy()
rds_conn_shutdown() can return before the connection is shut down when it encounters an existing state that it doesn't understand. This lets rds_conn_destroy() then start tearing down the conn from under paths that are still using it. It's more reliable the shutdown work and wait for krdsd to complete the shutdown callback. This stopped some hangs I was seeing where krdsd was trying to shut down a freed conn. Signed-off-by: Zach Brown <firstname.lastname@example.org>
1 files changed, 7 insertions, 2 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c
index 968b7a798398..519b4fe962b6 100644
@@ -312,6 +312,10 @@ void rds_conn_shutdown(struct rds_connection *conn)
* Stop and free a connection.
+ * This can only be used in very limited circumstances. It assumes that once
+ * the conn has been shutdown that no one else is referencing the connection.
+ * We can only ensure this in the rmmod path in the current code.
void rds_conn_destroy(struct rds_connection *conn)
@@ -326,10 +330,11 @@ void rds_conn_destroy(struct rds_connection *conn)
+ /* shut the connection down */
/* tear down queued messages */