Commit 4b1e84ed authored by Peng Tao's avatar Peng Tao Committed by Greg Kroah-Hartman

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: default avatarPeng Tao <tao.peng@emc.com>
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4d2d6e29
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment