From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Paul Fulghum <paulkf@microgate.com>
Cc: Diego Calleja <diegocg@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: pppd oopses current linu's git tree on disconnect
Date: Tue, 24 Jan 2006 23:25:29 +0000 [thread overview]
Message-ID: <1138145129.21284.12.camel@localhost.localdomain> (raw)
In-Reply-To: <1138140391.3223.15.camel@amdx2.microgate.com>
On Maw, 2006-01-24 at 16:06 -0600, Paul Fulghum wrote:
> I reasonably sure that your problem is lack
> of locking for the new tty buffering scheme.
> There is a question of how to best fix it
> with minimal code change and impact on performance.
Yeah the new tty code assumed the same locking rules as the old tty code
and nobody on the planet followed them since 2.2.
> I've done some initial testing with success.
> Let me know what you think.
I think you've been reading my mind, only you've actually come up with a
slightly neater variant than I have half coded here.
> int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size)
> {
> int space = tty_buffer_request_room(tty, size);
> - struct tty_buffer *tb = tty->buf.tail;
> - *chars = tb->char_buf_ptr + tb->used;
> - memset(tb->flag_buf_ptr + tb->used, TTY_NORMAL, space);
> - tb->used += space;
> + if (space) {
> + struct tty_buffer *tb = tty->buf.tail;
> + *chars = tb->char_buf_ptr + tb->used;
> + memset(tb->flag_buf_ptr + tb->used, TTY_NORMAL, space);
> + tb->used += space;
> + }
This seems unrelated and also not useful. 0 space is such a special case
that it isn't worth the check - and it works fine anyway with 0.
> + if (space) {
> + struct tty_buffer *tb = tty->buf.tail;
> + *chars = tb->char_buf_ptr + tb->used;
> + *flags = tb->flag_buf_ptr + tb->used;
> + tb->used += space;
> + }
Ditto
> --- linux-2.6.16-rc1/include/linux/kbd_kern.h 2006-01-17 09:31:29.000000000 -0600
> +++ linux-2.6.16-rc1-mg/include/linux/kbd_kern.h 2006-01-24 15:38:19.000000000 -0600
> @@ -151,6 +151,11 @@ extern unsigned int keymap_count;
>
> static inline void con_schedule_flip(struct tty_struct *t)
Should die as a duplicate by the look of it, and the tty one probably
should cease to be inline.
Looks good to me.
Alan
next prev parent reply other threads:[~2006-01-24 23:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-19 0:06 Diego Calleja
2006-01-19 17:33 ` Paul Fulghum
2006-01-19 22:07 ` Diego Calleja
2006-01-19 22:39 ` Paul Fulghum
2006-01-23 2:42 ` Diego Calleja
2006-01-24 3:48 ` Diego Calleja
2006-01-24 22:06 ` Paul Fulghum
2006-01-24 23:25 ` Alan Cox [this message]
2006-01-24 23:44 ` Paul Fulghum
2006-01-25 0:22 ` Alan Cox
2006-01-25 21:00 ` Paul Fulghum
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=1138145129.21284.12.camel@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=diegocg@gmail.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
all inboxes | Powered by JetHome®