@@ -108,9 +108,9 @@ struct kib_tunables {
min((t)->lnd_peercredits_hiw, \
(u32)(conn)->ibc_queue_depth - 1))
-# define kiblnd_rdma_create_id(ns, cb, dev, ps, qpt) rdma_create_id(ns, cb, \
- dev, ps, \
- qpt)
+# define kiblnd_rdma_create_id(ns, cb, dev, ps, qpt) \
+ rdma_create_id((ns) ? (ns) : &init_net, cb, dev, ps, qpt)
+
/* 2 OOB shall suffice for 1 keepalive and 1 returning credits */
#define IBLND_OOB_CAPABLE(v) ((v) != IBLND_MSG_VERSION_1)
#define IBLND_OOB_MSGS(v) (IBLND_OOB_CAPABLE(v) ? 2 : 0)
@@ -458,14 +458,15 @@
if (!lnet_count_acceptor_nets()) /* not required */
return 0;
-
- lnet_acceptor_state.pta_ns = current->nsproxy->net_ns;
+ if (current->nsproxy && current->nsproxy->net_ns)
+ lnet_acceptor_state.pta_ns = current->nsproxy->net_ns;
+ else
+ lnet_acceptor_state.pta_ns = &init_net;
task = kthread_run(lnet_acceptor, (void *)(uintptr_t)secure,
"acceptor_%03ld", secure);
if (IS_ERR(task)) {
rc2 = PTR_ERR(task);
CERROR("Can't start acceptor thread: %ld\n", rc2);
-
return -ESRCH;
}
@@ -464,10 +464,10 @@ struct lnet_net *
ni->ni_nid = LNET_MKNID(net->net_id, 0);
/* Store net namespace in which current ni is being created */
- if (current->nsproxy->net_ns)
+ if (current->nsproxy && current->nsproxy->net_ns)
ni->ni_net_ns = get_net(current->nsproxy->net_ns);
else
- ni->ni_net_ns = NULL;
+ ni->ni_net_ns = get_net(&init_net);
ni->ni_state = LNET_NI_STATE_INIT;
list_add_tail(&ni->ni_netlist, &net->net_ni_added);
@@ -1642,7 +1642,10 @@ int lnet_inet_enumerate(struct lnet_inetdev **dev_list, struct net *ns)
int rc;
int i;
- nip = lnet_inet_enumerate(&ifaces, current->nsproxy->net_ns);
+ if (current->nsproxy && current->nsproxy->net_ns)
+ nip = lnet_inet_enumerate(&ifaces, current->nsproxy->net_ns);
+ else
+ nip = lnet_inet_enumerate(&ifaces, &init_net);
if (nip < 0) {
if (nip != -ENOENT) {
LCONSOLE_ERROR_MSG(0x117,
@@ -4826,9 +4826,9 @@ struct lnet_msg *
* If not, assign order above 0xffff0000,
* to make this ni not a priority.
*/
- if (!net_eq(ni->ni_net_ns, current->nsproxy->net_ns))
+ if (current->nsproxy &&
+ !net_eq(ni->ni_net_ns, current->nsproxy->net_ns))
order += 0xffff0000;
-
if (srcnidp)
*srcnidp = ni->ni_nid;
if (orderp)