Skip to content
Snippets Groups Projects
Commit 24fa163a authored by Zach Brown's avatar Zach Brown Committed by Andy Grover
Browse files

RDS/IB: wait for IB dev freeing work to finish during rmmod


The RDS IB client removal callback can queue work to drop the final reference
to an IB device.  We have to make sure that this function has returned before
we complete rmmod or the work threads can try to execute freed code.

Signed-off-by: default avatarZach Brown <zach.brown@oracle.com>
parent b6fb0df1
No related branches found
No related tags found
No related merge requests found
...@@ -336,11 +336,18 @@ static int rds_ib_laddr_check(__be32 addr) ...@@ -336,11 +336,18 @@ static int rds_ib_laddr_check(__be32 addr)
return ret; return ret;
} }
static void rds_ib_unregister_client(void)
{
ib_unregister_client(&rds_ib_client);
/* wait for rds_ib_dev_free() to complete */
flush_workqueue(rds_wq);
}
void rds_ib_exit(void) void rds_ib_exit(void)
{ {
rds_info_deregister_func(RDS_INFO_IB_CONNECTIONS, rds_ib_ic_info); rds_info_deregister_func(RDS_INFO_IB_CONNECTIONS, rds_ib_ic_info);
rds_ib_destroy_nodev_conns(); rds_ib_destroy_nodev_conns();
ib_unregister_client(&rds_ib_client); rds_ib_unregister_client();
rds_ib_sysctl_exit(); rds_ib_sysctl_exit();
rds_ib_recv_exit(); rds_ib_recv_exit();
rds_trans_unregister(&rds_ib_transport); rds_trans_unregister(&rds_ib_transport);
...@@ -404,7 +411,7 @@ out_recv: ...@@ -404,7 +411,7 @@ out_recv:
out_sysctl: out_sysctl:
rds_ib_sysctl_exit(); rds_ib_sysctl_exit();
out_ibreg: out_ibreg:
ib_unregister_client(&rds_ib_client); rds_ib_unregister_client();
out: out:
return ret; return ret;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment