netdev
[Top] [All Lists]

2.6.0-test8-bk3 net/ipv4/tcp.c change broken?

To: netdev@xxxxxxxxxxx
Subject: 2.6.0-test8-bk3 net/ipv4/tcp.c change broken?
From: Mikael Pettersson <mikpe@xxxxxxxxx>
Date: Sun, 26 Oct 2003 16:43:13 +0100 (MET)
Cc: linux-kernel@xxxxxxxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
The 2.6.0-test8-bk3 change to delay pending signals checking in
net/ipv4/tcp.c appears to be broken.

On machine A I run X and an xterm. Within that xterm I rlogin to
machine B. On machine B I start emacs in text mode (emacs -nw).

When machine A runs 2.6.0-test8-bk2 or older, emacs works as usual:
it uses the xterm's entire size, and responds correctly and instantly
to control characters like ^S (I-search, not xoff) and ^G (Quit).

When machine A runs 2.6.0-test8-bk3 or later, emacs starts in a
tiny 24 rows by 80 columns mode, ^S incorrectly sends xoff, ^G
isn't seen by emacs until after a one second delay, and similarly
there is a one second delay between exiting emacs and getting the
next shell prompt. While running emacs, if I beat on it with ^G
and ^L it eventually (after about 5-10 seconds) goes into the
xterm's full rows/columns mode.

Reverting 2.6.0-test8-bk3's net/ipv4/tcp.c patch (included below)
fixes these problems.

/Mikael

diff -ruN linux-2.6.0-test8-bk2/net/ipv4/tcp.c 
linux-2.6.0-test8-bk3/net/ipv4/tcp.c
--- linux-2.6.0-test8-bk2/net/ipv4/tcp.c        2003-10-26 15:52:26.000000000 
+0100
+++ linux-2.6.0-test8-bk3/net/ipv4/tcp.c        2003-10-26 15:51:58.000000000 
+0100
@@ -1540,17 +1540,6 @@
                if (copied && tp->urg_data && tp->urg_seq == *seq)
                        break;
 
-               /* We need to check signals first, to get correct SIGURG
-                * handling. FIXME: Need to check this doesn't impact 1003.1g
-                * and move it down to the bottom of the loop
-                */
-               if (signal_pending(current)) {
-                       if (copied)
-                               break;
-                       copied = timeo ? sock_intr_errno(timeo) : -EAGAIN;
-                       break;
-               }
-
                /* Next get a buffer. */
 
                skb = skb_peek(&sk->sk_receive_queue);
@@ -1587,6 +1576,7 @@
                            sk->sk_state == TCP_CLOSE ||
                            (sk->sk_shutdown & RCV_SHUTDOWN) ||
                            !timeo ||
+                           signal_pending(current) ||
                            (flags & MSG_PEEK))
                                break;
                } else {
@@ -1616,6 +1606,11 @@
                                copied = -EAGAIN;
                                break;
                        }
+
+                       if (signal_pending(current)) {
+                               copied = sock_intr_errno(timeo);
+                               break;
+                       }
                }
 
                cleanup_rbuf(sk, copied);

<Prev in Thread] Current Thread [Next in Thread>
  • 2.6.0-test8-bk3 net/ipv4/tcp.c change broken?, Mikael Pettersson <=