This prevents RDS from handling incoming rdma packets before RDS
completes initializing its recv/send components.
We don't need to call rds_rdma_listen_stop() if rds_rdma_listen_init()
didn't succeed.
We only need to call rds_ib_exit() if rds_ib_init() succeeds but
other parts fail. The same applies to rds_iw_init()/rds_iw_exit().
So we need to change error handling sequence accordingly.
Jump to ib/iw error handling path when we get an err code from
rds_rdma_listen_init().
Orabug:
21684447
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Reviewed-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Signed-off-by: Qing Huang <qing.huang@oracle.com>
Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
{
int ret;
- ret = rds_rdma_listen_init();
- if (ret)
- goto out;
-
ret = rds_iw_init();
if (ret)
- goto err_iw_init;
+ goto out;
ret = rds_ib_init();
if (ret)
goto err_ib_init;
+ ret = rds_rdma_listen_init();
+ if (ret)
+ goto err_rdma_listen_init;
+
if (!unload_allowed) {
printk(KERN_NOTICE "Module %s locked in memory until next boot\n",
MODULE_NAME);
goto out;
+err_rdma_listen_init:
+ /* We need to clean up both ib and iw components. */
+ rds_ib_exit();
err_ib_init:
+ /* Only rds_iw_init() completes at this point, so we don't have to
+ * do anything with rds_ib_exit().
+ */
rds_iw_exit();
-err_iw_init:
- rds_rdma_listen_stop();
out:
+ /* Either nothing is done successfully or everything succeeds at
+ * this point.
+ */
return ret;
}
module_init(rds_rdma_init);