DLM: Replace nodeid_to_addr with kernel_getpeername
PATCH 1/1 DLM: Replace nodeid_to_addr with kernel_getpeername
In reply to a message not in the archiveHi,
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.
Regards,
Bob Peterson
Red Hat File Systems
---
fs/dlm/lowcomms.c +2 -1
@@ -469,8 +469,9 @@ 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 (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(),
PATCH 1/1 DLM: Replace nodeid_to_addr with kernel_getpeername
----- Original Message -----
Quoted 20 lines
Hi,
This patch replaces the call to
nodeid_to_addrwith a call tokernel_getpeername. This avoids taking a spinlock because it may potentially be called from a softirq context.Regards,
Bob Peterson
Red Hat File SystemsSigned-off-by Bob Peterson <[email protected]>---
fs/dlm/lowcomms.c +0
-0
fs/dlm/lowcomms.c static void lowcomms_error_report(struct sock *sk) · line 477
Quoted 10 lines
fs/dlm/lowcomms.c +2
-1@@ -469,8 +469,9 @@ 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 (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(),
Hi,
Self-NACK. A problem was found during testing. I'll post a replacement shortly.
Regards,
Bob Peterson
Red Hat File Systems
PATCH 1/1 DLM: Replace nodeid_to_addr with kernel_getpeername
----- Original Message -----
Quoted 33 lines
----- Original Message -----
Quoted 20 lines
Hi,
This patch replaces the call to
nodeid_to_addrwith a call tokernel_getpeername. This avoids taking a spinlock because it may potentially be called from a softirq context.Regards,
Bob Peterson
Red Hat File SystemsSigned-off-by Bob Peterson <[email protected]>---
fs/dlm/lowcomms.c +0
-0fs/dlm/lowcomms.c static void lowcomms_error_report(struct sock *sk) · line 477
Quoted 10 lines
fs/dlm/lowcomms.c +2
-1@@ -469,8 +469,9 @@ 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 (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(),Hi,
Quoted 7 lines
Self-NACK. A problem was found during testing. I'll post a replacement shortly.
Regards,
Bob Peterson
Red Hat File Systems
Hi,
Here is the replacement patch I promised.
Regards,
Bob Peterson
Red Hat File Systems
---
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.
fs/dlm/lowcomms.c +3 -1
@@ -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(),