diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2018-01-04 06:52:59 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-05 13:39:18 -0500 |
commit | c90ecbfaf50d2d7db25c531d9169be7e47435f3f (patch) | |
tree | 51a00b04b5e2ecc649922007def9b8836fb76245 /net/rds/connection.c | |
parent | eb9aa1bfbad8c9fc280adf43cb480911295cfa3f (diff) |
rds: Use atomic flag to track connections being destroyed
Replace c_destroy_in_prog by using a bit in cp_flags that
can set/tested atomically.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/connection.c')
-rw-r--r-- | net/rds/connection.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c index 6492c0b608a4..1eed197e694f 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c @@ -366,7 +366,7 @@ void rds_conn_shutdown(struct rds_conn_path *cp) * to the conn hash, so we never trigger a reconnect on this * conn - the reconnect is always triggered by the active peer. */ cancel_delayed_work_sync(&cp->cp_conn_w); - if (conn->c_destroy_in_prog) + if (test_bit(RDS_DESTROY_PENDING, &cp->cp_flags)) return; rcu_read_lock(); if (!hlist_unhashed(&conn->c_hash_node)) { @@ -384,6 +384,8 @@ static void rds_conn_path_destroy(struct rds_conn_path *cp) { struct rds_message *rm, *rtmp; + set_bit(RDS_DESTROY_PENDING, &cp->cp_flags); + if (!cp->cp_transport_data) return; @@ -426,7 +428,6 @@ void rds_conn_destroy(struct rds_connection *conn) "%pI4\n", conn, &conn->c_laddr, &conn->c_faddr); - conn->c_destroy_in_prog = 1; /* Ensure conn will not be scheduled for reconnect */ spin_lock_irq(&rds_conn_lock); hlist_del_init_rcu(&conn->c_hash_node); @@ -685,7 +686,7 @@ void rds_conn_path_drop(struct rds_conn_path *cp, bool destroy) { atomic_set(&cp->cp_state, RDS_CONN_ERROR); - if (!destroy && cp->cp_conn->c_destroy_in_prog) + if (!destroy && test_bit(RDS_DESTROY_PENDING, &cp->cp_flags)) return; queue_work(rds_wq, &cp->cp_down_w); |