From: Wang Shilong Date: Wed, 6 Aug 2014 06:16:42 +0000 (+0800) Subject: LU-5455 ptlrpc: fix magic return value of ptlrpc_init_portals X-Git-Tag: 2.6.52~31 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=3485238de84848740aaaa05f78da2cb53b81d3a0 LU-5455 ptlrpc: fix magic return value of ptlrpc_init_portals 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 Change-Id: Ib0c893052b4cd4f2e9b427fb4ce91da356065351 Reviewed-on: http://review.whamcloud.com/11337 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: James Simmons Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/events.c b/lustre/ptlrpc/events.c index 6c3be43..96e68d4 100644 --- a/lustre/ptlrpc/events.c +++ b/lustre/ptlrpc/events.c @@ -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); - return (-ENOENT); + return rc; } /* 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(); - return (-ENOMEM); + return rc; } #ifndef __KERNEL__ @@ -804,7 +804,7 @@ int ptlrpc_init_portals(void) if (rc != 0) { CERROR("network initialisation failed\n"); - return -EIO; + return rc; } #ifndef __KERNEL__ INIT_LIST_HEAD(&liblustre_wait_callbacks);