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>
This commit is contained in:
Peng Tao 2013-07-15 22:27:07 +08:00 committed by Greg Kroah-Hartman
parent 4d2d6e29a8
commit 4b1e84ed88

View File

@ -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();