diff options
author | Zach Brown <zach.brown@oracle.com> | 2010-06-25 17:58:16 -0400 |
---|---|---|
committer | Andy Grover <andy.grover@oracle.com> | 2010-09-08 21:16:33 -0400 |
commit | 8aeb1ba6630ffd44001ae9833842794df0107676 (patch) | |
tree | bc9a78da5281b371d3a9ecb2e00f7c381d9cd33b /net/rds/ib_rdma.c | |
parent | 24fa163a4bae74b3378d30e1bc776568cfca8121 (diff) |
RDS/IB: destroy connections on rmmod
IB connections were not being destroyed during rmmod.
First, recently IB device removal callback was changed to disconnect
connections that used the removing device rather than destroying them. So
connections with devices during rmmod were not being destroyed.
Second, rds_ib_destroy_nodev_conns() was being called before connections are
disassociated with devices. It would almost never find connections in the
nodev list.
We first get rid of rds_ib_destroy_conns(), which is no longer called, and
refactor the existing caller into the main body of the function and get rid of
the list and lock wrappers.
Then we call rds_ib_destroy_nodev_conns() *after* ib_unregister_client() has
removed the IB device from all the conns and put the conns on the nodev list.
The result is that IB connections are destroyed by rmmod.
Signed-off-by: Zach Brown <zach.brown@oracle.com>
Diffstat (limited to 'net/rds/ib_rdma.c')
-rw-r--r-- | net/rds/ib_rdma.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index 2a4ec1182ba6..00f3995351c8 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c | |||
@@ -198,16 +198,15 @@ void rds_ib_remove_conn(struct rds_ib_device *rds_ibdev, struct rds_connection * | |||
198 | rds_ib_dev_put(rds_ibdev); | 198 | rds_ib_dev_put(rds_ibdev); |
199 | } | 199 | } |
200 | 200 | ||
201 | void __rds_ib_destroy_conns(struct list_head *list, spinlock_t *list_lock) | 201 | void rds_ib_destroy_nodev_conns(void) |
202 | { | 202 | { |
203 | struct rds_ib_connection *ic, *_ic; | 203 | struct rds_ib_connection *ic, *_ic; |
204 | LIST_HEAD(tmp_list); | 204 | LIST_HEAD(tmp_list); |
205 | 205 | ||
206 | /* avoid calling conn_destroy with irqs off */ | 206 | /* avoid calling conn_destroy with irqs off */ |
207 | spin_lock_irq(list_lock); | 207 | spin_lock_irq(&ib_nodev_conns_lock); |
208 | list_splice(list, &tmp_list); | 208 | list_splice(&ib_nodev_conns, &tmp_list); |
209 | INIT_LIST_HEAD(list); | 209 | spin_unlock_irq(&ib_nodev_conns_lock); |
210 | spin_unlock_irq(list_lock); | ||
211 | 210 | ||
212 | list_for_each_entry_safe(ic, _ic, &tmp_list, ib_node) | 211 | list_for_each_entry_safe(ic, _ic, &tmp_list, ib_node) |
213 | rds_conn_destroy(ic->conn); | 212 | rds_conn_destroy(ic->conn); |