Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-5874 lnet: reject invalid net configuration
[fs/lustre-release.git]
/
lnet
/
lnet
/
acceptor.c
diff --git
a/lnet/lnet/acceptor.c
b/lnet/lnet/acceptor.c
index
c83843c
..
6bb9f85
100644
(file)
--- a/
lnet/lnet/acceptor.c
+++ b/
lnet/lnet/acceptor.c
@@
-43,11
+43,13
@@
static int accept_port = 988;
static int accept_backlog = 127;
static int accept_timeout = 5;
static int accept_backlog = 127;
static int accept_timeout = 5;
-struct {
+st
atic st
ruct {
int pta_shutdown;
cfs_socket_t *pta_sock;
struct completion pta_signal;
int pta_shutdown;
cfs_socket_t *pta_sock;
struct completion pta_signal;
-} lnet_acceptor_state;
+} lnet_acceptor_state = {
+ .pta_shutdown = 1
+};
int
lnet_acceptor_port(void)
int
lnet_acceptor_port(void)
@@
-79,7
+81,7
@@
CFS_MODULE_PARM(accept_timeout, "i", int, 0644,
static char *accept_type = NULL;
static char *accept_type = NULL;
-int
+
static
int
lnet_acceptor_get_tunables(void)
{
/* Userland acceptor uses 'accept_type' instead of 'accept', due to
lnet_acceptor_get_tunables(void)
{
/* Userland acceptor uses 'accept_type' instead of 'accept', due to
@@
-259,7
+261,7
@@
lnet_acceptor_get_tunables()
/* Below is the code common for both kernel and MT user-space */
/* Below is the code common for both kernel and MT user-space */
-int
+
static
int
lnet_accept(cfs_socket_t *sock, __u32 magic)
{
lnet_acceptor_connreq_t cr;
lnet_accept(cfs_socket_t *sock, __u32 magic)
{
lnet_acceptor_connreq_t cr;
@@
-386,7
+388,7
@@
lnet_accept(cfs_socket_t *sock, __u32 magic)
return rc;
}
return rc;
}
-int
+
static
int
lnet_acceptor(void *arg)
{
cfs_socket_t *newsock;
lnet_acceptor(void *arg)
{
cfs_socket_t *newsock;
@@
-508,6
+510,10
@@
lnet_acceptor_start(void)
long rc2;
long secure;
long rc2;
long secure;
+ /* if acceptor is already running return immediately */
+ if (!lnet_acceptor_state.pta_shutdown)
+ return 0;
+
LASSERT (lnet_acceptor_state.pta_sock == NULL);
rc = lnet_acceptor_get_tunables();
LASSERT (lnet_acceptor_state.pta_sock == NULL);
rc = lnet_acceptor_get_tunables();
@@
-558,7
+564,7
@@
lnet_acceptor_start(void)
void
lnet_acceptor_stop(void)
{
void
lnet_acceptor_stop(void)
{
- if (lnet_acceptor_state.pta_s
ock == NULL
) /* not running */
+ if (lnet_acceptor_state.pta_s
hutdown
) /* not running */
return;
lnet_acceptor_state.pta_shutdown = 1;
return;
lnet_acceptor_state.pta_shutdown = 1;