mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Adam Tlałka" <atlka@pg.gda.pl>
To: "Adam Tlałka" <atlka@pg.gda.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: [PATCH 0/1] SIGWINCH problem with terminal apps still alive
Date: Fri, 10 Oct 2008 03:12:34 +0200	[thread overview]
Message-ID: <20081010031234.4030b176@merlin.oi.pg.gda.pl> (raw)
In-Reply-To: <20081007222857.11f92ca0@merlin.oi.pg.gda.pl>

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

Welcome,

now we have 2.6.26.6 kernel and still terminal resize leads to
undesired effects. It is very inconvenient to wait for 2.6.27 for
corrections.

As Alan Cox previously said mutexes generally work but as we can
observe in case of kill_pgrp() call inside mutex lock we got
race because of rescheduling so lock is not working here.
Rearanging code so the variable change is placed before kill_pgrp()
call removes mentioned race situaction.   

Signed-off-by: Adam Tla/lka <atlka@pg.gda.pl>

I strongly suggest to patch actual 2.6.26.x kernel to remove this very
nasty pts behaviour.

Regards

-- 
Adam Tlałka       mailto:atlka@pg.gda.pl    ^v^ ^v^ ^v^

[-- Attachment #2: 2.6.26.6_tty_io.patch --]
[-- Type: text/x-patch, Size: 639 bytes --]

--- drivers/char/tty_io_orig.c	2008-10-10 02:30:18.000000000 +0200
+++ drivers/char/tty_io.c	2008-10-10 02:33:38.000000000 +0200
@@ -3014,6 +3014,9 @@ static int tiocswinsz(struct tty_struct 
 		}
 	}
 #endif
+	tty->winsize = tmp_ws;
+	real_tty->winsize = tmp_ws;
+
 	/* Get the PID values and reference them so we can
 	   avoid holding the tty ctrl lock while sending signals */
 	spin_lock_irqsave(&tty->ctrl_lock, flags);
@@ -3028,9 +3031,6 @@ static int tiocswinsz(struct tty_struct 
 
 	put_pid(pgrp);
 	put_pid(rpgrp);
-
-	tty->winsize = tmp_ws;
-	real_tty->winsize = tmp_ws;
 done:
 	mutex_unlock(&tty->termios_mutex);
 	return 0;

[-- Attachment #3: 2.6.26.6_vt.patch --]
[-- Type: text/x-patch, Size: 493 bytes --]

--- drivers/char/vt_orig.c	2008-10-10 02:12:40.000000000 +0200
+++ drivers/char/vt.c	2008-10-10 02:31:28.000000000 +0200
@@ -921,11 +921,11 @@ int vc_resize(struct vc_data *vc, unsign
 		if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col))
 			pgrp = get_pid(vc->vc_tty->pgrp);
 		spin_unlock_irq(&vc->vc_tty->ctrl_lock);
+		*cws = ws;
 		if (pgrp) {
 			kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1);
 			put_pid(pgrp);
 		}
-		*cws = ws;
 		mutex_unlock(&vc->vc_tty->termios_mutex);
 	}
 

  reply	other threads:[~2008-10-10  1:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-06 12:07 [PATCH 0/0] SIGWINCH problem with terminal apps Adam Tlałka
2008-10-06 13:13 ` Alan Cox
2008-10-06 18:28   ` Adam Tlałka
2008-10-06 22:14     ` Alan Cox
2008-10-07 20:28       ` Adam Tlałka
2008-10-10  1:12         ` Adam Tlałka [this message]
2008-10-10  3:32           ` [PATCH 0/1] SIGWINCH problem with terminal apps still alive Adam Tlałka
2008-10-10  9:29           ` Alan Cox
2008-10-10 10:35             ` Adam Tlałka
2008-10-10 11:56               ` Adam Tlałka
     [not found] <bjXel-4CU-17@gated-at.bofh.it>
     [not found] ` <bjYap-5Q0-25@gated-at.bofh.it>
     [not found]   ` <bk30i-3Gx-1@gated-at.bofh.it>
     [not found]     ` <bk6AV-8ms-7@gated-at.bofh.it>
     [not found]       ` <bkrvO-1HF-49@gated-at.bofh.it>
     [not found]         ` <blePJ-6rI-3@gated-at.bofh.it>
     [not found]           ` <blmDC-7ZU-7@gated-at.bofh.it>
2008-10-11 14:04             ` Bodo Eggert
2008-10-11 17:58               ` Alan Cox

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=20081010031234.4030b176@merlin.oi.pg.gda.pl \
    --to=atlka@pg.gda.pl \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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®