[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] Re: [NFS] [RFC PATCH 1/3] NLM lock failover - lock release

On Thursday June 29, wcheng redhat com wrote:
> On Thu, 2006-06-29 at 19:06 -0400, Trond Myklebust wrote:
> > >  
> > > +	/* add server ip for nlm lock failover */
> > > +	sock->ops->getname(sock, (struct sockaddr *)&daddr, &alen, 0);
> > > +	rqstp->rq_daddr = daddr.sin_addr.s_addr;
> > > +
> > 
> > Hmm.... Why would you want to do this on every receive when you could
> > just store the ip address in the struct svc_sock once and for all?
> ok, will do that - save latency. Thanks.
> > 
> > That said, how do you envisage this working in the cases where the
> > socket is bound to INADDR_ANY?
> This is "our" (server's) address, not peer address - for this request to
> arrive "here", it can't be INADDR_ANY. Can it ? Remember "rq_daddr" will
> only be used during failover in a clustered NFS servers environment. 

The socket can only be bound to INADDR_ANY for UDP, and in that case
we already set rq_daddr correctly.

For a TCP socket, it will be connected, so the local an remote
endpoints will be well defined.

So the code as it stands should work fine.

But yes, it would be best to record the local and remote addresses in
svc_tcp_accept rather than called ->getname twice in svc_recvfrom.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]