[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090105082817.GD22131@xi.wantstofly.org>
Date: Mon, 5 Jan 2009 09:28:17 +0100
From: Lennert Buytenhek <buytenh@...tstofly.org>
To: David Miller <davem@...emloft.net>
Cc: jarkao2@...il.com, jens.axboe@...cle.com, ben@...s.com,
opurdila@...acom.com, netdev@...r.kernel.org
Subject: Re: splice from half-closed socket returning -EAGAIN
On Mon, Jan 05, 2009 at 12:14:01AM -0800, David Miller wrote:
> > > > tcp: don't mask EOF and socket errors on nonblocking splice receive
> > > >
> > > > Currently, setting SPLICE_F_NONBLOCK on splice from a TCP socket
> > > > results in masking of EOF (RDHUP) and error conditions on the socket
> > > > by an -EAGAIN return. Move the NONBLOCK check in tcp_splice_read()
> > > > to be after the EOF and error checks to fix this.
> > > >
> > > > Signed-off-by: Lennert Buytenhek <buytenh@...vell.com>
> > >
> > > This change looks like the perfect fix for this problem.
> > >
> >
> > Actually, I wonder why this "if (flags & SPLICE_F_NONBLOCK)" can't
> > be skipped at all. Isn't "if (!timeo)" enough now?
>
> Is it really the same condition in the end?
It _seems_ to be? This:
timeo = sock_rcvtimeo(sk, flags & SPLICE_F_NONBLOCK);
sets 'timeo' to zero if SPLICE_F_NONBLOCK is set. And when we get
to the timeo / SPLICE_F_NONBLOCK checks, it must be in the first
iteration of the loop, because if 'spliced' was nonzero, it would
have broken out of the loop earlier, and we wouldn't have reached
the check at all.
So it would seem that the SPLICE_F_NONBLOCK check can be deleted
entirely.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists