All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fill in rqstp->rq_daddr in svc_tcp_recvfrom
@ 2005-07-12  9:04 Olaf Kirch
  2005-07-12 16:31 ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Olaf Kirch @ 2005-07-12  9:04 UTC (permalink / raw)
  To: nfs

Here's a patch we added to SLES in response to a customer bug report:

# Subject: Fill in rqstp->rq_daddr in svc_tcp_recvfrom
#
# This patch fills the daddr member of the rpc struct svc_rqst structure for  
# TCP-based sockets in the recvfrom proceedure.  Currently, the field is 
# not set thus leaving it with left over garbage from a previous allocation. 
#
# This makes the behavior consistent between UDP- and TCP-based RPC. 
#
# This patch enables HA software to failover TCP-based RPC services
# such as TCP-based NFS. 
#
# Signed-off-by: okir@suse.de

Index: linux-2.6.12.orig/net/sunrpc/svcsock.c
===================================================================
--- linux-2.6.12.orig/net/sunrpc/svcsock.c	2005-07-08 11:45:25.000000000 +0200
+++ linux-2.6.12/net/sunrpc/svcsock.c	2005-07-12 10:57:05.000000000 +0200
@@ -455,8 +455,9 @@ svc_recvfrom(struct svc_rqst *rqstp, str
 	struct socket	*sock;
 	int		len, alen;
 
-	rqstp->rq_addrlen = sizeof(rqstp->rq_addr);
 	sock = rqstp->rq_sock->sk_sock;
+	rqstp->rq_daddr = inet_sk((const struct sock *)sock)->rcv_saddr;
+	rqstp->rq_addrlen = sizeof(rqstp->rq_addr);
 
 	msg.msg_name    = &rqstp->rq_addr;
 	msg.msg_namelen = sizeof(rqstp->rq_addr);
-- 
Olaf Kirch   |  --- o --- Nous sommes du soleil we love when we play
okir@suse.de |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fill in rqstp->rq_daddr in svc_tcp_recvfrom
  2005-07-12  9:04 [PATCH] Fill in rqstp->rq_daddr in svc_tcp_recvfrom Olaf Kirch
@ 2005-07-12 16:31 ` J. Bruce Fields
  2005-07-13  5:17   ` Olaf Kirch
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2005-07-12 16:31 UTC (permalink / raw)
  To: Olaf Kirch; +Cc: nfs

On Tue, Jul 12, 2005 at 11:04:56AM +0200, Olaf Kirch wrote:
> Here's a patch we added to SLES in response to a customer bug report:
> 
> # Subject: Fill in rqstp->rq_daddr in svc_tcp_recvfrom
> #
> # This patch fills the daddr member of the rpc struct svc_rqst structure for  
> # TCP-based sockets in the recvfrom proceedure.  Currently, the field is 
> # not set thus leaving it with left over garbage from a previous allocation. 
> #
> # This makes the behavior consistent between UDP- and TCP-based RPC. 
> #
> # This patch enables HA software to failover TCP-based RPC services
> # such as TCP-based NFS.

Could you explain how this patch makes a difference?  I can only see the
value of rq_daddr used in one place, in svc_sendto:
        if (rqstp->rq_prot == IPPROTO_UDP) {
...
                pki->ipi_spec_dst.s_addr = rqstp->rq_daddr;

                if (sock_sendmsg(sock, &msg, 0) < 0)
                        goto out;
        }

So it doesn't seem to be used at all in the TCP case.  Am I confused?

--b.


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fill in rqstp->rq_daddr in svc_tcp_recvfrom
  2005-07-12 16:31 ` J. Bruce Fields
@ 2005-07-13  5:17   ` Olaf Kirch
  2005-07-13 14:36     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Olaf Kirch @ 2005-07-13  5:17 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: nfs

Hi Bruce,

> Could you explain how this patch makes a difference?  I can only see the
> value of rq_daddr used in one place, in svc_sendto:

It doesn't make a difference for the existing RPC users, but the customer
had some kernel RPC code of their own (I think some HA capable nfsd)
that needed this information for migration/failover.

It's not strictly necessary, but it doesn't hurt either - and it makes
sense in the way that UDP and TCP now fill in the same set of information.

Olaf
-- 
Olaf Kirch   |  --- o --- Nous sommes du soleil we love when we play
okir@suse.de |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fill in rqstp->rq_daddr in svc_tcp_recvfrom
  2005-07-13  5:17   ` Olaf Kirch
@ 2005-07-13 14:36     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2005-07-13 14:36 UTC (permalink / raw)
  To: Olaf Kirch; +Cc: J. Bruce Fields, nfs

On Wed, Jul 13, 2005 at 07:17:50AM +0200, Olaf Kirch wrote:
> Hi Bruce,
> 
> > Could you explain how this patch makes a difference?  I can only see the
> > value of rq_daddr used in one place, in svc_sendto:
> 
> It doesn't make a difference for the existing RPC users, but the customer
> had some kernel RPC code of their own (I think some HA capable nfsd)
> that needed this information for migration/failover.

So let the customer post the patch, including the code that uses it,
as that might actually be useful for others aswell.



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-13 14:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-12  9:04 [PATCH] Fill in rqstp->rq_daddr in svc_tcp_recvfrom Olaf Kirch
2005-07-12 16:31 ` J. Bruce Fields
2005-07-13  5:17   ` Olaf Kirch
2005-07-13 14:36     ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.