linux/net/rds
Haggai Eran 7c1eb45a22 IB/core: lock client data with lists_rwsem
An ib_client callback that is called with the lists_rwsem locked only for
read is protected from changes to the IB client lists, but not from
ib_unregister_device() freeing its client data. This is because
ib_unregister_device() will remove the device from the device list with
lists_rwsem locked for write, but perform the rest of the cleanup,
including the call to remove() without that lock.

Mark client data that is undergoing de-registration with a new going_down
flag in the client data context. Lock the client data list with lists_rwsem
for write in addition to using the spinlock, so that functions calling the
callback would be able to lock only lists_rwsem for read and let callbacks
sleep.

Since ib_unregister_client() now marks the client data context, no need for
remove() to search the context again, so pass the client data directly to
remove() callbacks.

Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-08-30 15:48:21 -04:00
..
af_rds.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
bind.c net/rds: Add setsockopt support for SO_RDS_TRANSPORT 2015-05-31 21:47:23 -07:00
cong.c rds: rds_cong_queue_updates needs to defer the congestion update transmission 2015-02-11 14:35:44 -08:00
connection.c net/rds: RDS-TCP: only initiate reconnect attempt on outgoing TCP socket. 2015-05-09 16:03:28 -04:00
ib_cm.c IB/core: Change ib_create_cq to use struct ib_cq_init_attr 2015-06-12 14:49:10 -04:00
ib_rdma.c rds: rds_ib_device.refcount overflow 2015-07-14 13:20:11 -04:00
ib_recv.c RDS: Switch to generic logging helpers 2015-05-18 13:44:23 -04:00
ib_ring.c
ib_send.c Merge branch 'for-4.2-misc' into k.o/for-4.2 2015-06-02 09:33:22 -04:00
ib_stats.c
ib_sysctl.c
ib.c IB/core: lock client data with lists_rwsem 2015-08-30 15:48:21 -04:00
ib.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
info.c rds: fix an integer overflow test in rds_info_getsockopt() 2015-08-03 15:20:16 -07:00
info.h
iw_cm.c IB/core: Change ib_create_cq to use struct ib_cq_init_attr 2015-06-12 14:49:10 -04:00
iw_rdma.c rds: avoid potential stack overflow 2015-03-12 00:28:01 -04:00
iw_recv.c rds: switch ->inc_copy_to_user() to passing iov_iter 2014-11-24 05:16:43 -05:00
iw_ring.c
iw_send.c rds: re-entry of rds_ib_xmit/rds_iw_xmit 2015-06-02 09:22:31 -04:00
iw_stats.c
iw_sysctl.c
iw.c IB/core: lock client data with lists_rwsem 2015-08-30 15:48:21 -04:00
iw.h rds: switch ->inc_copy_to_user() to passing iov_iter 2014-11-24 05:16:43 -05:00
Kconfig
loop.c
loop.h
Makefile
message.c rds: Make rds_message_copy_from_user() return 0 on success. 2015-02-07 22:41:56 -08:00
page.c
rdma_transport.c RDS: Switch to generic logging helpers 2015-05-18 13:44:23 -04:00
rdma_transport.h
rdma.c rds: avoid calling sock_kfree_s() on allocation failure 2014-10-14 17:00:19 -04:00
rds.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
recv.c net: Remove iocb argument from sendmsg and recvmsg 2015-03-02 13:06:31 -05:00
send.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-04-14 15:44:14 -04:00
stats.c
sysctl.c net: rds: use correct size for max unacked packets and bytes 2015-02-04 16:07:27 -08:00
tcp_connect.c net/rds: RDS-TCP: Always create a new rds_sock for an incoming connection. 2015-05-09 16:03:27 -04:00
tcp_listen.c net/rds: RDS-TCP: Always create a new rds_sock for an incoming connection. 2015-05-09 16:03:27 -04:00
tcp_recv.c rds: switch ->inc_copy_to_user() to passing iov_iter 2014-11-24 05:16:43 -05:00
tcp_send.c
tcp_stats.c
tcp.c
tcp.h rds: switch ->inc_copy_to_user() to passing iov_iter 2014-11-24 05:16:43 -05:00
threads.c
transport.c net-RDS: Delete an unnecessary check before the function call "module_put" 2015-07-03 09:27:42 -07:00