Skip to content

Commit 1a31833

Browse files
AstralBobteigland
authored andcommitted
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 <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent 81f70ba commit 1a31833

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/dlm/lowcomms.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,10 @@ static void lowcomms_error_report(struct sock *sk)
469469
{
470470
struct connection *con = sock2con(sk);
471471
struct sockaddr_storage saddr;
472+
int buflen;
472473

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

0 commit comments

Comments
 (0)