Whamcloud - gitweb
LU-5455 ptlrpc: fix magic return value of ptlrpc_init_portals 37/11337/3
authorWang Shilong <wshilong@ddn.com>
Wed, 6 Aug 2014 06:16:42 +0000 (14:16 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 25 Aug 2014 17:01:04 +0000 (17:01 +0000)
Previously, when running 'modprobe lustre', it hit the following
error message which is becaue of network initialisation failure:
modprobe: ERROR: could not insert 'lustre': Input/output error

However, error code is there, just let it return to caller,
after this patch, error message will be something like:
modprobe: ERROR: could not insert 'lustre': Network is down

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: Ib0c893052b4cd4f2e9b427fb4ce91da356065351
Reviewed-on: http://review.whamcloud.com/11337
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ptlrpc/events.c

index 6c3be43..96e68d4 100644 (file)
@@ -614,7 +614,7 @@ int ptlrpc_ni_init(void)
         rc = LNetNIInit(pid);
         if (rc < 0) {
                 CDEBUG (D_NET, "Can't init network interface: %d\n", rc);
         rc = LNetNIInit(pid);
         if (rc < 0) {
                 CDEBUG (D_NET, "Can't init network interface: %d\n", rc);
-                return (-ENOENT);
+               return rc;
         }
 
         /* CAVEAT EMPTOR: how we process portals events is _radically_
         }
 
         /* CAVEAT EMPTOR: how we process portals events is _radically_
@@ -637,7 +637,7 @@ int ptlrpc_ni_init(void)
         CERROR ("Failed to allocate event queue: %d\n", rc);
         LNetNIFini();
 
         CERROR ("Failed to allocate event queue: %d\n", rc);
         LNetNIFini();
 
-        return (-ENOMEM);
+       return rc;
 }
 
 #ifndef __KERNEL__
 }
 
 #ifndef __KERNEL__
@@ -804,7 +804,7 @@ int ptlrpc_init_portals(void)
 
         if (rc != 0) {
                 CERROR("network initialisation failed\n");
 
         if (rc != 0) {
                 CERROR("network initialisation failed\n");
-                return -EIO;
+               return rc;
         }
 #ifndef __KERNEL__
        INIT_LIST_HEAD(&liblustre_wait_callbacks);
         }
 #ifndef __KERNEL__
        INIT_LIST_HEAD(&liblustre_wait_callbacks);