fs: dlm: fix mark per nodeid setting

This patch fixes to set per nodeid mark configuration for accepted
sockets as well. Before this patch only the listen socket mark value was
used for all accepted connections. This patch will ensure that the
cluster mark attribute value will be always used for all sockets, if a
per nodeid mark value is specified dlm will use this value for the
specific node.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
Alexander Aring
2020-09-24 10:31:23 -04:00
committed by David Teigland
parent 0461e0db94
commit 3f78cd7d24
3 changed files with 17 additions and 13 deletions

View File

@@ -790,6 +790,7 @@ static int accept_from_sock(struct connection *con)
int nodeid;
struct connection *newcon;
struct connection *addcon;
unsigned int mark;
if (!dlm_allow_conn) {
return -1;
@@ -826,6 +827,9 @@ static int accept_from_sock(struct connection *con)
return -1;
}
dlm_comm_mark(nodeid, &mark);
sock_set_mark(newsock->sk, mark);
log_print("got connection from %d", nodeid);
/* Check to see if we already have a connection to this node. This
@@ -971,9 +975,7 @@ static void sctp_connect_to_sock(struct connection *con)
return;
}
result = dlm_comm_mark(con->nodeid, &mark);
if (result < 0)
return;
dlm_comm_mark(con->nodeid, &mark);
mutex_lock(&con->sock_mutex);
@@ -1071,9 +1073,7 @@ static void tcp_connect_to_sock(struct connection *con)
return;
}
result = dlm_comm_mark(con->nodeid, &mark);
if (result < 0)
return;
dlm_comm_mark(con->nodeid, &mark);
mutex_lock(&con->sock_mutex);
if (con->retries++ > MAX_CONNECT_RETRIES)