All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: kuznet@ms2.inr.ac.ru
Cc: "David S. Miller" <davem@redhat.com>,
	ralf@nyren.net, linux-kernel@vger.kernel.org
Subject: Re: 2.4.4: Kernel crash, possibly tcp related
Date: Tue, 1 May 2001 12:47:56 +0200	[thread overview]
Message-ID: <20010501124756.B805@athlon.random> (raw)
In-Reply-To: <15084.62398.56283.772414@pizda.ninka.net> <200104301700.VAA18188@ms2.inr.ac.ru>
In-Reply-To: <200104301700.VAA18188@ms2.inr.ac.ru>; from kuznet@ms2.inr.ac.ru on Mon, Apr 30, 2001 at 09:00:09PM +0400

On Mon, Apr 30, 2001 at 09:00:09PM +0400, kuznet@ms2.inr.ac.ru wrote:
> Hello!
> 
> > My current theory is that tcpblast does something erratic when the
> > error occurs.
> 
> It has buffer size of 32K, so that it faults at enough large chunk sizes.
> 
> Erratic errno is because this applet prints errno on partial write.
> 
> Oops is apparently because I did something wrong in do_fault yet.
> Seems, you were right telling that this place looks dubious. 8)

this is the strict fix:

diff -urN z/net/ipv4/tcp.c z1/net/ipv4/tcp.c
--- z/net/ipv4/tcp.c	Tue May  1 12:14:14 2001
+++ z1/net/ipv4/tcp.c	Tue May  1 12:12:35 2001
@@ -1184,7 +1184,7 @@
 do_fault:
 	if (skb->len==0) {
 		if (tp->send_head == skb) {
-			tp->send_head = skb->prev;
+			tp->send_head = skb->next;
 			if (tp->send_head == (struct sk_buff*)&sk->write_queue)
 				tp->send_head = NULL;
 		}


really the logic can be implemented more efficiently this way:

--- 2.4.4aa3/net/ipv4/tcp.c.~1~	Tue May  1 10:44:57 2001
+++ 2.4.4aa3/net/ipv4/tcp.c	Tue May  1 12:00:25 2001
@@ -1183,11 +1183,8 @@
 
 do_fault:
 	if (skb->len==0) {
-		if (tp->send_head == skb) {
-			tp->send_head = skb->next;
-			if (tp->send_head == (struct sk_buff*)&sk->write_queue)
-				tp->send_head = NULL;
-		}
+		if (tp->send_head == skb)
+			tp->send_head = NULL;
 		__skb_unlink(skb, skb->list);
 		tcp_free_skb(sk, skb);
 	}

Andrea

  reply	other threads:[~2001-05-01 10:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-29 14:29 2.4.4: Kernel crash, possibly tcp related Ralf Nyren
2001-04-30  5:10 ` David S. Miller
2001-04-30  6:42   ` J Sloan
     [not found]   ` <3AED0A7A.7263E27B@uow.edu.au>
2001-04-30  6:58     ` David S. Miller
2001-04-30 14:41       ` Ralf Nyren
2001-04-30 16:46       ` Andrea Arcangeli
2001-04-30 17:22         ` Ingo Oeser
2001-04-30 17:00   ` kuznet
2001-05-01 10:47     ` Andrea Arcangeli [this message]
2001-05-01 16:44       ` kuznet
2001-05-01 17:09         ` Andrea Arcangeli
2001-05-01 17:25           ` kuznet
2001-05-01 17:32             ` Andrea Arcangeli
2001-05-01 18:10               ` kuznet
2001-05-01 23:08                 ` David S. Miller

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=20010501124756.B805@athlon.random \
    --to=andrea@suse.de \
    --cc=davem@redhat.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ralf@nyren.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.