]> git.baikalelectronics.ru Git - kernel.git/commit
rds: use RCU to synchronize work-enqueue with connection teardown
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Thu, 4 Jan 2018 14:53:00 +0000 (06:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Jan 2018 18:39:18 +0000 (13:39 -0500)
commitc2151131b2caaa89a2a2c45e92b325fa3fe81a76
tree67f61aa4784da3fba56aa43e3626d3f3b6562c78
parent7c7aab589441937ad36139649c91e2eb529e2f12
rds: use RCU to synchronize work-enqueue with connection teardown

rds_sendmsg() can enqueue work on cp_send_w from process context, but
it should not enqueue this work if connection teardown  has commenced
(else we risk enquing work after rds_conn_path_destroy() has assumed that
all work has been cancelled/flushed).

Similarly some other functions like rds_cong_queue_updates
and rds_tcp_data_ready are called in softirq context, and may end
up enqueuing work on rds_wq after rds_conn_path_destroy() has assumed
that all workqs are quiesced.

Check the RDS_DESTROY_PENDING bit and use rcu synchronization to avoid
all these races.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/cong.c
net/rds/connection.c
net/rds/send.c
net/rds/tcp_recv.c
net/rds/tcp_send.c
net/rds/threads.c