mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kuznet@ms2.inr.ac.ru
To: andrea@suse.de (Andrea Arcangeli)
Cc: 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 20:44:52 +0400 (MSK DST)	[thread overview]
Message-ID: <200105011644.UAA32621@ms2.inr.ac.ru> (raw)
In-Reply-To: <20010501124756.B805@athlon.random> from "Andrea Arcangeli" at May 1, 1 12:47:56 pm

Hello!

> this is the strict fix:

Andrea, you caught the problem!

The fix is not right though (it is equivalent to straight
tp->send_head=NULL, as you noticed. It also corrupts queue in
an opposite manner.) Right fix is appended.

Explanation: in do_fault we must undo effect of enqueueing new segment
in the case the segment remained empty. tp->send_head points to
the first unsent skb in queue and it is NULL when and only when
all the skbs are already sent. (Invariant is: tp->send_head==NULL ||
tp->send_head->seq == tp->snd_nxt)
I crapped this case except for the case when queue is completely empty,
so that the last sent skb was accounted in packets_out twice...

Damn, what a silly mistake was it... shame.

Alexey


--- ../vger3-010426/linux/net/ipv4/tcp.c	Wed Apr 25 21:02:18 2001
+++ linux/net/ipv4/tcp.c	Tue May  1 20:38:44 2001
@@ -1185,7 +1187,7 @@
 	if (skb->len==0) {
 		if (tp->send_head == skb) {
 			tp->send_head = skb->prev;
-			if (tp->send_head == (struct sk_buff*)&sk->write_queue)
+			if (TCP_SKB_CB(skb)->seq == tp->snd_nxt)
 				tp->send_head = NULL;
 		}
 		__skb_unlink(skb, skb->list);

  reply	other threads:[~2001-05-01 16:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3AED0A7A.7263E27B@uow.edu.au>
2001-04-29 14:29 ` Ralf Nyren
2001-04-30  5:10   ` David S. Miller
2001-04-30  6:42     ` J Sloan
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
2001-05-01 16:44         ` kuznet [this message]
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=200105011644.UAA32621@ms2.inr.ac.ru \
    --to=kuznet@ms2.inr.ac.ru \
    --cc=andrea@suse.de \
    --cc=davem@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®