public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Chuck Ebbert <76306.1226@compuserve.com>,
	Paul Fulghum <paulkf@microgate.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Linux 2.6.16.28
Date: Sat, 26 Aug 2006 17:51:59 +0200	[thread overview]
Message-ID: <20060826155159.GJ4765@stusta.de> (raw)
In-Reply-To: <200608261023_MC3-1-C96A-6EC3@compuserve.com>

On Sat, Aug 26, 2006 at 10:20:43AM -0400, Chuck Ebbert wrote:
> In-Reply-To: <20060826003639.GA4765@stusta.de>
> 
> On Sat, 26 Aug 2006 02:36:39 +0200, Adrian Bunk wrote:
> 
> > Location:
> > ftp://ftp.kernel.org/pub/linux/kernel/v2.6/
> 
> Could you post the incremental patch as a reply like Greg does?

After Michaels reminder I've put it at ftp.kernel.org .

> And are you going to apply Paul Fulghum's tty patch?  Without it
> I get solid lockup on pppd disconnect about once a month.

I've still many patches (including parts of four 2.6.17 releases) to 
review and I wasn't yet there.

Paul, can you ACK that this patch is OK for 2.6.16?

> Chuck

cu
Adrian



Subject: tty serialize flush_to_ldisc

From: Paul Fulghum <paulkf@microgate.com>

Serialize processing of tty buffers in flush_to_ldisc
to fix (very rare) corruption of tty buffer free list
on SMP systems.

Signed-off-by: Paul Fulghum <paulkf@microgate.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 drivers/char/tty_io.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

--- linux-2.6.17.7.orig/drivers/char/tty_io.c
+++ linux-2.6.17.7/drivers/char/tty_io.c
@@ -2776,7 +2776,7 @@ static void flush_to_ldisc(void *private
 	struct tty_struct *tty = (struct tty_struct *) private_;
 	unsigned long 	flags;
 	struct tty_ldisc *disc;
-	struct tty_buffer *tbuf;
+	struct tty_buffer *tbuf, *head;
 	int count;
 	char *char_buf;
 	unsigned char *flag_buf;
@@ -2793,7 +2793,9 @@ static void flush_to_ldisc(void *private
 		goto out;
 	}
 	spin_lock_irqsave(&tty->buf.lock, flags);
-	while((tbuf = tty->buf.head) != NULL) {
+	head = tty->buf.head;
+	tty->buf.head = NULL;
+	while((tbuf = head) != NULL) {
 		while ((count = tbuf->commit - tbuf->read) != 0) {
 			char_buf = tbuf->char_buf_ptr + tbuf->read;
 			flag_buf = tbuf->flag_buf_ptr + tbuf->read;
@@ -2802,10 +2804,12 @@ static void flush_to_ldisc(void *private
 			disc->receive_buf(tty, char_buf, flag_buf, count);
 			spin_lock_irqsave(&tty->buf.lock, flags);
 		}
-		if (tbuf->active)
+		if (tbuf->active) {
+			tty->buf.head = head;
 			break;
-		tty->buf.head = tbuf->next;
-		if (tty->buf.head == NULL)
+		}
+		head = tbuf->next;
+		if (head == NULL)
 			tty->buf.tail = NULL;
 		tty_buffer_free(tty, tbuf);
 	}

  reply	other threads:[~2006-08-26 15:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-26 14:20 Linux 2.6.16.28 Chuck Ebbert
2006-08-26 15:51 ` Adrian Bunk [this message]
2006-08-26 16:35   ` Michael Buesch
2006-08-26 18:30   ` Paul Fulghum
2006-08-27  1:37     ` Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2006-08-26  0:36 Adrian Bunk
2006-08-26 11:00 ` Michael Buesch
2006-08-26 12:55   ` Adrian Bunk

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=20060826155159.GJ4765@stusta.de \
    --to=bunk@stusta.de \
    --cc=76306.1226@compuserve.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulkf@microgate.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