Skip to content

Commit

Permalink
RDS: use locking on the connection hash list
Browse files Browse the repository at this point in the history
rds_conn_destroy really needs locking while it changes the
connection hash.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason authored and Andy Grover committed Sep 9, 2010
1 parent c9e6538 commit abf4543
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/rds/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,10 @@ void rds_conn_destroy(struct rds_connection *conn)
"%pI4\n", conn, &conn->c_laddr,
&conn->c_faddr);

/* Ensure conn will not be scheduled for reconnect */
spin_lock_irq(&rds_conn_lock);
hlist_del_init(&conn->c_hash_node);
spin_unlock_irq(&rds_conn_lock);

/* wait for the rds thread to shut it down */
atomic_set(&conn->c_state, RDS_CONN_ERROR);
Expand Down

0 comments on commit abf4543

Please sign in to comment.