提交 4b1e84ed 编写于 作者: P Peng Tao 提交者: 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: NPeng Tao <tao.peng@emc.com>
Signed-off-by: NAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册