From: Lennert Buytenhek <buytenh@wantstofly.org>
To: David Miller <davem@davemloft.net>
Cc: jarkao2@gmail.com, jens.axboe@oracle.com, ben@zeus.com,
opurdila@ixiacom.com, netdev@vger.kernel.org
Subject: Re: splice from half-closed socket returning -EAGAIN
Date: Mon, 5 Jan 2009 09:28:17 +0100 [thread overview]
Message-ID: <20090105082817.GD22131@xi.wantstofly.org> (raw)
In-Reply-To: <20090105.001401.63730458.davem@davemloft.net>
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@marvell.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.
prev parent reply other threads:[~2009-01-05 8:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-04 13:30 splice from half-closed socket returning -EAGAIN Lennert Buytenhek
2009-01-05 6:47 ` Lennert Buytenhek
2009-01-05 7:59 ` David Miller
2009-01-05 8:03 ` Jens Axboe
2009-01-05 8:11 ` Jarek Poplawski
2009-01-05 8:14 ` David Miller
2009-01-05 8:22 ` Jarek Poplawski
2009-01-05 8:52 ` David Miller
2009-01-05 8:54 ` David Miller
2009-01-05 8:28 ` Lennert Buytenhek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090105082817.GD22131@xi.wantstofly.org \
--to=buytenh@wantstofly.org \
--cc=ben@zeus.com \
--cc=davem@davemloft.net \
--cc=jarkao2@gmail.com \
--cc=jens.axboe@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=opurdila@ixiacom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox