linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kuznet@ms2.inr.ac.ru
To: davem@redhat.com (David S. Miller)
Cc: torvalds@osdl.org (Linus Torvalds),
	akpm@osdl.org, Andries.Brouwer@cwi.nl,
	linux-kernel@vger.kernel.org, netdev@oss.sgi.com,
	kuznet@ms2.inr.ac.ru
Subject: Re: Linux 2.6.0-test9
Date: Mon, 27 Oct 2003 22:54:41 +0300 (MSK)	[thread overview]
Message-ID: <200310271954.WAA07541@yakov.inr.ac.ru> (raw)
In-Reply-To: <20031026224358.233e6d1a.davem@redhat.com> from "David S. Miller" at Oct 26, 2003 10:43:58 PM

Hello!


> But I am starting to see that URG is different.  It is not like
> other socket errors that halt the socket and make no new data
> arrive after it happens.  Rather, URG can happen just about anywhere
> and more data can continue to flow into the socket buffers.
> 
> In fact, this means that our change can result in an application
> can never see the error if data continues to arrive faster than
> the application can pull it out, see?
> 
> Alexey, I think we did not understand this case fully when making this
> change.

No doubts taking into account that the things are so badly broken. :-)

But I was aware about this problem and even "proved" to you that the patch
will not change anything. :-) Remember this?


> I found only one more or less essential difference: when we have one oob
> octet in the stream with data following it, read() can return -EINTR/RESTART
> due to pending SIGURG and normal data will be read at the second read(),
> or, alternatively, it can return data following oob octet immediately.
>
> In practice there is no real difference: SIGURG is processed before read()
> returns in any case and even more, with restartable signals it is just
> exactly no difference.


Actually, I considered the same thing:

>--- 1.49/net/ipv4/tcp.c	Mon Oct 20 22:27:42 2003
>+++ edited/net/ipv4/tcp.c	Sun Oct 26 17:59:14 2003
>@@ -1536,9 +1536,15 @@
> 		struct sk_buff *skb;
> 		u32 offset;
> 
>-		/* Are we at urgent data? Stop if we have read anything. */
>-		if (copied && tp->urg_data && tp->urg_seq == *seq)
>-			break;
>+		/* Are we at urgent data? Stop if we have read anything or have SIGURG pending. */
>+		if (tp->urg_data && tp->urg_seq == *seq) {
>+			if (copied)
>+				break;
>+			if (signal_pending(current)) {
>+				copied = timeo ? sock_intr_errno(timeo) : -EAGAIN;
>+				break;
>+			}
>+		}
> 
> 		/* Next get a buffer. */
> 

as a reliable workaround for SIGURG situation, but then "figured out"
that this is not necessary (which was mistake). Though at the moment I still
do not understand what exactly is so wrong with that my argument, the signal
should be processed before read() returns, should not it? Maybe, rlogin
longjmp()s or something like this...

Alexey

  reply	other threads:[~2003-10-27 19:55 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-26 19:40 Linux 2.6.0-test9 Andries.Brouwer
2003-10-27  0:01 ` Andrew Morton
2003-10-27  0:21   ` Linus Torvalds
2003-10-27  0:28     ` Linus Torvalds
2003-10-27  6:43       ` David S. Miller
2003-10-27 19:54         ` kuznet [this message]
2003-10-27 19:36     ` kuznet
2003-10-28  0:42       ` Tommy Christensen
2003-10-28 18:25         ` kuznet
  -- strict thread matches above, loose matches on Subject: below --
2003-10-27 10:58 Andries.Brouwer
2003-10-27  9:47 Mikael Pettersson
2003-10-27  1:48 Andries.Brouwer
2003-10-27  2:10 ` Linus Torvalds
2003-10-27  9:40   ` David S. Miller
2003-10-26 18:51 P. Christeas
2003-10-27  3:16 ` Andrew Morton
2003-10-26 15:32 Shane Shrybman
2003-10-26 16:27 ` Marco Roeland
2003-10-26 11:08 Andries.Brouwer
2003-10-26 13:57 ` OGAWA Hirofumi
2003-10-26 10:59 Andries.Brouwer
2003-10-27 23:37 ` bill davidsen
2003-10-26 10:26 Andries.Brouwer
2003-10-26  1:16 Andries.Brouwer
2003-10-26  3:12 ` OGAWA Hirofumi
2003-10-26  5:48 ` Linus Torvalds
2003-10-27 23:26   ` bill davidsen
2003-10-30  9:20     ` Russell King
2003-10-30 16:44       ` Bill Davidsen
2003-10-30 17:23         ` John Bradford
2003-10-25 19:09 Linus Torvalds
2003-10-25 19:52 ` Marcelo Tosatti
2003-10-25 20:14 ` viro
2003-10-25 22:35   ` Linus Torvalds
2003-10-25 23:45 ` Jose Luis Domingo Lopez
2003-10-26 12:05 ` Patrik Wallstrom
2003-10-27 18:21   ` Patrik Wallstrom
2003-10-27 22:51     ` bill davidsen
2003-10-28  2:12       ` Jeff Garzik
2003-10-28  4:52         ` Bill Davidsen

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=200310271954.WAA07541@yakov.inr.ac.ru \
    --to=kuznet@ms2.inr.ac.ru \
    --cc=Andries.Brouwer@cwi.nl \
    --cc=akpm@osdl.org \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=torvalds@osdl.org \
    /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;
as well as URLs for NNTP newsgroup(s).