public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shachar Shemesh <shachar@liveu.tv>
To: unlisted-recipients:; (no To-header on input)
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Subject: [PATCH] tty ldisc: Close/Reopen race prevention should check the proper flag
Date: Sun, 01 Jul 2012 09:53:19 +0300	[thread overview]
Message-ID: <4FEFF3DF.9000909@liveu.tv> (raw)

From: Shachar Shemesh <shachar@liveu.tv>

Commit acfa747b introduced the TTY_HUPPING flag to distinguish closed 
TTY from currently closing ones. The test in tty_set_ldisc still 
remained pointing at the old flag. This causes pppd to sometimes lapse 
into uninterruptible sleep when killed and restarted.

Signed-off-by: Shachar Shemesh <shachar@liveu.tv>
---
Tested with 3.2.20 kernel.

diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 24b95db..a662a24 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -658,7 +658,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
          goto enable;
      }

-    if (test_bit(TTY_HUPPED, &tty->flags)) {
+    if (test_bit(TTY_HUPPING, &tty->flags)) {
          /* We were raced by the hangup method. It will have stomped
             the ldisc data and closed the ldisc down */
          clear_bit(TTY_LDISC_CHANGING, &tty->flags);



             reply	other threads:[~2012-07-01  6:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-01  6:53 Shachar Shemesh [this message]
2012-07-06 21:24 ` Subject: [PATCH] tty ldisc: Close/Reopen race prevention should check the proper flag Greg KH
2012-07-08  8:58   ` Shachar Shemesh
2012-07-09 16:44     ` Greg KH
2012-07-10  4:54       ` Shachar Shemesh
2012-09-19 19:25         ` Jiri Slaby
2012-09-22  8:35           ` Sasha Levin
2012-09-22  8:42             ` Jiri Slaby
2012-12-19 14:05           ` Džiugas Baltrūnas

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=4FEFF3DF.9000909@liveu.tv \
    --to=shachar@liveu.tv \
    --cc=linux-kernel@vger.kernel.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