[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0909040910140.4537@eeepc.linux-foundation.org>
Date: Fri, 4 Sep 2009 09:11:58 -1000 (HST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Mikael Pettersson <mikpe@...uu.se>
cc: "Rafael J. Wysocki" <rjw@...k.pl>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Kernel Testers List <kernel-testers@...r.kernel.org>,
Alan Cox <alan@...ux.intel.com>, Greg KH <gregkh@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Subject: Re: [Bug #14015] pty regressed again, breaking expect and gcc's
testsuite
On Fri, 4 Sep 2009, Linus Torvalds wrote:
>
> So I'm starting to suspect that the real bug is that we do that
> 'pty_space()' in pty_write() call at all. The _callers_ should already
> have done the write_room() check, and if somebody doesn't do it, then the
> tty buffering will eventually do a hard limit at the 65kB allocation mark.
Ok, so the thought was right, but the patch was obviously not even
compiled, because the compiler points out that 'c' was not initialized.
I'm sure you already figured the obvious meaning out, but here's a fixed
version.
Linus
---
drivers/char/pty.c | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index d083c73..b33d668 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -109,21 +109,13 @@ static int pty_space(struct tty_struct *to)
* the other side of the pty/tty pair.
*/
-static int pty_write(struct tty_struct *tty, const unsigned char *buf,
- int count)
+static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
{
struct tty_struct *to = tty->link;
- int c;
if (tty->stopped)
return 0;
- /* This isn't locked but our 8K is quite sloppy so no
- big deal */
-
- c = pty_space(to);
- if (c > count)
- c = count;
if (c > 0) {
/* Stuff the data into the input queue of the other end */
c = tty_insert_flip_string(to, buf, c);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists