]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/rds: start rdma listening after ib/iw initialization is done
authorQing Huang <qing.huang@oracle.com>
Tue, 6 Oct 2015 22:32:22 +0000 (15:32 -0700)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Thu, 22 Oct 2015 09:43:28 +0000 (02:43 -0700)
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>
net/rds/rdma_transport.c

index e8c175d14d7eaabc9a2903c8098040b12fb8fd7e..b5c4834c4385c1afd66d0a15dacca58b20c1b356 100644 (file)
@@ -447,18 +447,18 @@ int rds_rdma_init(void)
 {
        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);
@@ -467,11 +467,18 @@ int rds_rdma_init(void)
 
        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);