diff options
author | Bob Peterson <rpeterso@redhat.com> | 2016-01-18 12:29:15 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2016-02-22 15:02:11 -0500 |
commit | 1a31833d085a339cf42573de0717209e8b2172e8 (patch) | |
tree | 15c64f85564e28ef00cba6b248d321bc7fad0a99 | |
parent | 81f70ba233d5f660e1ea5fe23260ee323af5d53a (diff) |
DLM: Replace nodeid_to_addr with kernel_getpeername
This patch replaces the call to nodeid_to_addr with a call to
kernel_getpeername. This avoids taking a spinlock because it may
potentially be called from a softirq context.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
-rw-r--r-- | fs/dlm/lowcomms.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 3a37bd3f9637..dc9ae6d670dc 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c | |||
@@ -469,8 +469,10 @@ static void lowcomms_error_report(struct sock *sk) | |||
469 | { | 469 | { |
470 | struct connection *con = sock2con(sk); | 470 | struct connection *con = sock2con(sk); |
471 | struct sockaddr_storage saddr; | 471 | struct sockaddr_storage saddr; |
472 | int buflen; | ||
472 | 473 | ||
473 | if (nodeid_to_addr(con->nodeid, &saddr, NULL, false)) { | 474 | if (con->sock == NULL || |
475 | kernel_getpeername(con->sock, (struct sockaddr *)&saddr, &buflen)) { | ||
474 | printk_ratelimited(KERN_ERR "dlm: node %d: socket error " | 476 | printk_ratelimited(KERN_ERR "dlm: node %d: socket error " |
475 | "sending to node %d, port %d, " | 477 | "sending to node %d, port %d, " |
476 | "sk_err=%d/%d\n", dlm_our_nodeid(), | 478 | "sk_err=%d/%d\n", dlm_our_nodeid(), |