summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lnet
diff options
context:
space:
mode:
authorPeng Tao <bergwolf@gmail.com>2013-07-15 14:27:07 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-23 19:23:57 (GMT)
commit4b1e84ed8883d4f24f99417cb84165ff77a99d66 (patch)
tree744bed601c9b15aacaa74e7bd2566d4226680597 /drivers/staging/lustre/lnet
parent4d2d6e29a8d56bd05cc7ea30ddfb4d3f75290cfe (diff)
downloadlinux-fsl-qoriq-4b1e84ed8883d4f24f99417cb84165ff77a99d66.tar.xz
staging/lustre: don't assert ln_refcount in LNetGetId
If LNetNIInit() fails, we'll get zero ln_refcount. So fail LNetGetId() properly instead of asserting. We can get to it when socklnd fails to scan network interfaces, which is possible if Lustre is builtin. Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet')
-rw-r--r--drivers/staging/lustre/lnet/lnet/api-ni.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index e88bee3..250c618 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1541,7 +1541,10 @@ LNetGetId(unsigned int index, lnet_process_id_t *id)
int rc = -ENOENT;
LASSERT(the_lnet.ln_init);
- LASSERT(the_lnet.ln_refcount > 0);
+
+ /* LNetNI initilization failed? */
+ if (the_lnet.ln_refcount == 0)
+ return rc;
cpt = lnet_net_lock_current();