projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea81986
)
RDS: lock rds_conn_count decrement in rds_conn_destroy()
author
Zach Brown
<zach.brown@oracle.com>
Fri, 23 Jul 2010 17:30:45 +0000
(10:30 -0700)
committer
Andy Grover
<andy.grover@oracle.com>
Thu, 9 Sep 2010 01:16:45 +0000
(18:16 -0700)
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>
net/rds/connection.c
patch
|
blob
|
blame
|
history
diff --git
a/net/rds/connection.c
b/net/rds/connection.c
index 0de40d9563ca82a0d2505c7e2381b79238a15dee..75a1a37d64d34e5975bbce1c262454a87f2c483f 100644
(file)
--- a/
net/rds/connection.c
+++ b/
net/rds/connection.c
@@
-313,6
+313,7
@@
void rds_conn_shutdown(struct rds_connection *conn)
void rds_conn_destroy(struct rds_connection *conn)
{
struct rds_message *rm, *rtmp;
+ unsigned long flags;
rdsdebug("freeing conn %p for %pI4 -> "
"%pI4\n", conn, &conn->c_laddr,
@@
-350,7
+351,9
@@
void rds_conn_destroy(struct rds_connection *conn)
BUG_ON(!list_empty(&conn->c_retrans));
kmem_cache_free(rds_conn_slab, conn);
+ spin_lock_irqsave(&rds_conn_lock, flags);
rds_conn_count--;
+ spin_unlock_irqrestore(&rds_conn_lock, flags);
}
EXPORT_SYMBOL_GPL(rds_conn_destroy);