diff options
author | Zach Brown <zach.brown@oracle.com> | 2010-07-23 13:30:45 -0400 |
---|---|---|
committer | Andy Grover <andy.grover@oracle.com> | 2010-09-08 21:16:45 -0400 |
commit | fe8ff6b58f040dd52d2db45972db8e0301847f1c (patch) | |
tree | e332f689cfd9838b585f6106ff493672ce1db598 /net/rds/connection.c | |
parent | ea819867b788728aca60717e4fdacb3df771f670 (diff) |
RDS: lock rds_conn_count decrement in rds_conn_destroy()
rds_conn_destroy() can race with all other modifications of the
rds_conn_count but it was modifying the count without locking.
Signed-off-by: Zach Brown <zach.brown@oracle.com>
Diffstat (limited to 'net/rds/connection.c')
-rw-r--r-- | net/rds/connection.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c index 0de40d9563ca..75a1a37d64d3 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c | |||
@@ -313,6 +313,7 @@ void rds_conn_shutdown(struct rds_connection *conn) | |||
313 | void rds_conn_destroy(struct rds_connection *conn) | 313 | void rds_conn_destroy(struct rds_connection *conn) |
314 | { | 314 | { |
315 | struct rds_message *rm, *rtmp; | 315 | struct rds_message *rm, *rtmp; |
316 | unsigned long flags; | ||
316 | 317 | ||
317 | rdsdebug("freeing conn %p for %pI4 -> " | 318 | rdsdebug("freeing conn %p for %pI4 -> " |
318 | "%pI4\n", conn, &conn->c_laddr, | 319 | "%pI4\n", conn, &conn->c_laddr, |
@@ -350,7 +351,9 @@ void rds_conn_destroy(struct rds_connection *conn) | |||
350 | BUG_ON(!list_empty(&conn->c_retrans)); | 351 | BUG_ON(!list_empty(&conn->c_retrans)); |
351 | kmem_cache_free(rds_conn_slab, conn); | 352 | kmem_cache_free(rds_conn_slab, conn); |
352 | 353 | ||
354 | spin_lock_irqsave(&rds_conn_lock, flags); | ||
353 | rds_conn_count--; | 355 | rds_conn_count--; |
356 | spin_unlock_irqrestore(&rds_conn_lock, flags); | ||
354 | } | 357 | } |
355 | EXPORT_SYMBOL_GPL(rds_conn_destroy); | 358 | EXPORT_SYMBOL_GPL(rds_conn_destroy); |
356 | 359 | ||