diff options
author | Chris Mason <chris.mason@oracle.com> | 2010-05-11 18:11:11 -0400 |
---|---|---|
committer | Andy Grover <andy.grover@oracle.com> | 2010-09-08 21:15:09 -0400 |
commit | 7e3f2952eeb1a0fe2aa9882fd1705a88f9d89b35 (patch) | |
tree | 903d89d0d1184bd1f33df2b5036615d1c40cfb06 /net/rds/message.c | |
parent | 38a4e5e61344490f18241333d7b1b368a3a38748 (diff) |
rds: don't let RDS shutdown a connection while senders are present
This is the first in a long line of patches that tries to fix races
between RDS connection shutdown and RDS traffic.
Here we are maintaining a count of active senders to make sure
the connection doesn't go away while they are using it.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'net/rds/message.c')
-rw-r--r-- | net/rds/message.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/rds/message.c b/net/rds/message.c index 96e2bf7dc77e..84f937f11d47 100644 --- a/net/rds/message.c +++ b/net/rds/message.c | |||
@@ -81,7 +81,10 @@ static void rds_message_purge(struct rds_message *rm) | |||
81 | void rds_message_put(struct rds_message *rm) | 81 | void rds_message_put(struct rds_message *rm) |
82 | { | 82 | { |
83 | rdsdebug("put rm %p ref %d\n", rm, atomic_read(&rm->m_refcount)); | 83 | rdsdebug("put rm %p ref %d\n", rm, atomic_read(&rm->m_refcount)); |
84 | 84 | if (atomic_read(&rm->m_refcount) == 0) { | |
85 | printk(KERN_CRIT "danger refcount zero on %p\n", rm); | ||
86 | WARN_ON(1); | ||
87 | } | ||
85 | if (atomic_dec_and_test(&rm->m_refcount)) { | 88 | if (atomic_dec_and_test(&rm->m_refcount)) { |
86 | BUG_ON(!list_empty(&rm->m_sock_item)); | 89 | BUG_ON(!list_empty(&rm->m_sock_item)); |
87 | BUG_ON(!list_empty(&rm->m_conn_item)); | 90 | BUG_ON(!list_empty(&rm->m_conn_item)); |