Whamcloud - gitweb
LU-13042 tests: give more time in sanity-selinux test_21b
[fs/lustre-release.git] / lnet / lnet / acceptor.c
index 7dff9d5..232018b 100644 (file)
@@ -159,7 +159,7 @@ lnet_connect(struct socket **sockp, lnet_nid_t peer_nid,
        int                     port;
        int                     fatal;
 
-       CLASSERT(sizeof(cr) <= 16);             /* not too big to be on the stack */
+       BUILD_BUG_ON(sizeof(cr) > 16); /* not too big to be on the stack */
 
        for (port = LNET_ACCEPTOR_MAX_RESERVED_PORT;
             port >= LNET_ACCEPTOR_MIN_RESERVED_PORT;
@@ -175,7 +175,7 @@ lnet_connect(struct socket **sockp, lnet_nid_t peer_nid,
                        continue;
                }
 
-               CLASSERT(LNET_PROTO_ACCEPTOR_VERSION == 1);
+               BUILD_BUG_ON(LNET_PROTO_ACCEPTOR_VERSION != 1);
 
                cr.acr_magic   = LNET_PROTO_ACCEPTOR_MAGIC;
                cr.acr_version = LNET_PROTO_ACCEPTOR_VERSION;
@@ -480,14 +480,15 @@ lnet_acceptor_start(void)
 
        if (lnet_count_acceptor_nets() == 0)  /* 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;
        }