Skip to content

Commit

Permalink
DLM: Replace nodeid_to_addr with kernel_getpeername
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
AstralBob authored and teigland committed Feb 22, 2016
1 parent 81f70ba commit 1a31833
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,10 @@ static void lowcomms_error_report(struct sock *sk)
{
struct connection *con = sock2con(sk);
struct sockaddr_storage saddr;
int buflen;

if (nodeid_to_addr(con->nodeid, &saddr, NULL, false)) {
if (con->sock == NULL ||
kernel_getpeername(con->sock, (struct sockaddr *)&saddr, &buflen)) {
printk_ratelimited(KERN_ERR "dlm: node %d: socket error "
"sending to node %d, port %d, "
"sk_err=%d/%d\n", dlm_our_nodeid(),
Expand Down

0 comments on commit 1a31833

Please sign in to comment.