linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* write_ports delfd case
@ 2010-07-19 19:21 J. Bruce Fields
  2010-07-19 19:32 ` Chuck Lever
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2010-07-19 19:21 UTC (permalink / raw)
  To: Chuck Lever, Neil Brown; +Cc: linux-nfs

Does anyone know what __write_ports_delfd() is meant to do?

The block comment above write_ports claims it handles writes of the form
"-<file descriptor>", which makes no sense (the file table of the writer
has nothing to do with anything).  It's called only when the character
after the "-" is a digit, but the names it matches against (generated by
svc_one_sock_name()) start with "ipv4" or "ipv6".

I guess we should just rip out that case entirely?  Or maybe I'm missing
something.

--b.

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

* Re: write_ports delfd case
  2010-07-19 19:21 write_ports delfd case J. Bruce Fields
@ 2010-07-19 19:32 ` Chuck Lever
  2010-07-19 20:07   ` Jeff Layton
  0 siblings, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2010-07-19 19:32 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Neil Brown, Linux NFS Mailing List, Jeff Layton

On 07/19/10 03:21 PM, J. Bruce Fields wrote:
> Does anyone know what __write_ports_delfd() is meant to do?
>
> The block comment above write_ports claims it handles writes of the form
> "-<file descriptor>", which makes no sense (the file table of the writer
> has nothing to do with anything).  It's called only when the character
> after the "-" is a digit, but the names it matches against (generated by
> svc_one_sock_name()) start with "ipv4" or "ipv6".

I suspect the comment above write_ports() is not correct.  I assumed 
that delfd was symmetrical with addfd, but it isn't.  More likely, addfd 
returns a string name that can be passed to write_ports (with a 
preceding '-') to terminate the socket.

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

* Re: write_ports delfd case
  2010-07-19 19:32 ` Chuck Lever
@ 2010-07-19 20:07   ` Jeff Layton
       [not found]     ` <20100719160703.1e686a74-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Layton @ 2010-07-19 20:07 UTC (permalink / raw)
  To: Chuck Lever; +Cc: J. Bruce Fields, Neil Brown, Linux NFS Mailing List

On Mon, 19 Jul 2010 15:32:57 -0400
Chuck Lever <chuck.lever@oracle.com> wrote:

> On 07/19/10 03:21 PM, J. Bruce Fields wrote:
> > Does anyone know what __write_ports_delfd() is meant to do?
> >
> > The block comment above write_ports claims it handles writes of the form
> > "-<file descriptor>", which makes no sense (the file table of the writer
> > has nothing to do with anything).  It's called only when the character
> > after the "-" is a digit, but the names it matches against (generated by
> > svc_one_sock_name()) start with "ipv4" or "ipv6".
> 
> I suspect the comment above write_ports() is not correct.  I assumed 
> that delfd was symmetrical with addfd, but it isn't.  More likely, addfd 
> returns a string name that can be passed to write_ports (with a 
> preceding '-') to terminate the socket.

Yeah -- seems broken to me. Given that it clearly doesn't work and I'm
not aware of anyone having complained, perhaps it would be best to
remove it?

-- 
Jeff Layton <jlayton@redhat.com>

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

* Re: write_ports delfd case
       [not found]     ` <20100719160703.1e686a74-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
@ 2010-07-19 23:41       ` Neil Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Neil Brown @ 2010-07-19 23:41 UTC (permalink / raw)
  To: Jeff Layton; +Cc: Chuck Lever, J. Bruce Fields, Linux NFS Mailing List

On Mon, 19 Jul 2010 16:07:03 -0400
Jeff Layton <jlayton@redhat.com> wrote:

> On Mon, 19 Jul 2010 15:32:57 -0400
> Chuck Lever <chuck.lever@oracle.com> wrote:
> 
> > On 07/19/10 03:21 PM, J. Bruce Fields wrote:
> > > Does anyone know what __write_ports_delfd() is meant to do?
> > >
> > > The block comment above write_ports claims it handles writes of the form
> > > "-<file descriptor>", which makes no sense (the file table of the writer
> > > has nothing to do with anything).  It's called only when the character
> > > after the "-" is a digit, but the names it matches against (generated by
> > > svc_one_sock_name()) start with "ipv4" or "ipv6".
> > 
> > I suspect the comment above write_ports() is not correct.  I assumed 
> > that delfd was symmetrical with addfd, but it isn't.  More likely, addfd 
> > returns a string name that can be passed to write_ports (with a 
> > preceding '-') to terminate the socket.
> 
> Yeah -- seems broken to me. Given that it clearly doesn't work and I'm
> not aware of anyone having complained, perhaps it would be best to
> remove it?
> 

Looks like 
   a217813f9067b785241cb7f31956e51d2071703a

was the offending commit.  Adding the "isdigit" test is just wrong.

It is just *wrong* in other ways too.  You really should have a host address
as well as a port number to identify a socket endpoint, even if it is the
wildcard address.

Oh well.....

NeilBrown

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

end of thread, other threads:[~2010-07-19 23:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-19 19:21 write_ports delfd case J. Bruce Fields
2010-07-19 19:32 ` Chuck Lever
2010-07-19 20:07   ` Jeff Layton
     [not found]     ` <20100719160703.1e686a74-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-07-19 23:41       ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).