From: Peng Tao Date: Mon, 15 Jul 2013 14:27:07 +0000 (+0800) Subject: staging/lustre: don't assert ln_refcount in LNetGetId X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4b1e84ed8883d4f24f99417cb84165ff77a99d66;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index e88bee362497..250c61868704 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();