fs: dlm: remove lock dependency warning
During my experiments to make dlm robust against tcpkill application I was able to run sometimes in a circular lock dependency warning between clusters_root.subsys.su_mutex and con->sock_mutex. We don't need to held the sock_mutex when getting the mark value which held the clusters_root.subsys.su_mutex. This patch moves the specific handling just before the sock_mutex will be held. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:

committed by
David Teigland

parent
7ae0451e2e
commit
0461e0db94
@@ -971,6 +971,10 @@ static void sctp_connect_to_sock(struct connection *con)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result = dlm_comm_mark(con->nodeid, &mark);
|
||||||
|
if (result < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
mutex_lock(&con->sock_mutex);
|
mutex_lock(&con->sock_mutex);
|
||||||
|
|
||||||
/* Some odd races can cause double-connects, ignore them */
|
/* Some odd races can cause double-connects, ignore them */
|
||||||
@@ -995,11 +999,6 @@ static void sctp_connect_to_sock(struct connection *con)
|
|||||||
if (result < 0)
|
if (result < 0)
|
||||||
goto socket_err;
|
goto socket_err;
|
||||||
|
|
||||||
/* set skb mark */
|
|
||||||
result = dlm_comm_mark(con->nodeid, &mark);
|
|
||||||
if (result < 0)
|
|
||||||
goto bind_err;
|
|
||||||
|
|
||||||
sock_set_mark(sock->sk, mark);
|
sock_set_mark(sock->sk, mark);
|
||||||
|
|
||||||
con->rx_action = receive_from_sock;
|
con->rx_action = receive_from_sock;
|
||||||
@@ -1072,6 +1071,10 @@ static void tcp_connect_to_sock(struct connection *con)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result = dlm_comm_mark(con->nodeid, &mark);
|
||||||
|
if (result < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
mutex_lock(&con->sock_mutex);
|
mutex_lock(&con->sock_mutex);
|
||||||
if (con->retries++ > MAX_CONNECT_RETRIES)
|
if (con->retries++ > MAX_CONNECT_RETRIES)
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1086,11 +1089,6 @@ static void tcp_connect_to_sock(struct connection *con)
|
|||||||
if (result < 0)
|
if (result < 0)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
|
||||||
/* set skb mark */
|
|
||||||
result = dlm_comm_mark(con->nodeid, &mark);
|
|
||||||
if (result < 0)
|
|
||||||
goto out_err;
|
|
||||||
|
|
||||||
sock_set_mark(sock->sk, mark);
|
sock_set_mark(sock->sk, mark);
|
||||||
|
|
||||||
memset(&saddr, 0, sizeof(saddr));
|
memset(&saddr, 0, sizeof(saddr));
|
||||||
|
Reference in New Issue
Block a user