linux_dsm_epyc7002/drivers/infiniband/ulp/ipoib
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
..
ipoib_cm.c IB/ipoib: Scatter-Gather support in connected mode 2015-07-14 13:20:13 -04:00
ipoib_ethtool.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
ipoib_fs.c IPoIB: Remove unnecessary test for NULL before debugfs_remove() 2014-08-12 21:59:54 -07:00
ipoib_ib.c IB/ipoib: Scatter-Gather support in connected mode 2015-07-14 13:20:13 -04:00
ipoib_main.c IB/core: lock client data with lists_rwsem 2015-08-30 15:48:21 -04:00
ipoib_multicast.c IB/ipoib: Remove IPOIB_MCAST_RUN bit 2015-04-15 16:06:19 -04:00
ipoib_netlink.c infiniband: make sure the src net is infiniband when create new link 2014-01-03 20:38:56 -05:00
ipoib_verbs.c IB/ipoib: Fix CONFIG_INFINIBAND_IPOIB_CM 2015-07-24 11:34:26 -04:00
ipoib_vlan.c IB/ipoib: Fix ndo_get_iflink 2015-04-17 15:21:04 -04:00
ipoib.h IB/ipoib: Scatter-Gather support in connected mode 2015-07-14 13:20:13 -04:00
Kconfig kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT 2011-01-20 17:02:05 -08:00
Makefile IB/ipoib: Add rtnl_link_ops support 2012-09-20 16:49:17 -04:00