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>
This commit is contained in:
@ -81,7 +81,10 @@ static void rds_message_purge(struct rds_message *rm)
|
||||
void rds_message_put(struct rds_message *rm)
|
||||
{
|
||||
rdsdebug("put rm %p ref %d\n", rm, atomic_read(&rm->m_refcount));
|
||||
|
||||
if (atomic_read(&rm->m_refcount) == 0) {
|
||||
printk(KERN_CRIT "danger refcount zero on %p\n", rm);
|
||||
WARN_ON(1);
|
||||
}
|
||||
if (atomic_dec_and_test(&rm->m_refcount)) {
|
||||
BUG_ON(!list_empty(&rm->m_sock_item));
|
||||
BUG_ON(!list_empty(&rm->m_conn_item));
|
||||
|
Reference in New Issue
Block a user