Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275786
b: refs/heads/master
c: 0c73c08
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Nov 17, 2011
1 parent 02078e1 commit 96c7956
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 300420722e0734a4254f3b634e0f82664495d210
refs/heads/master: 0c73c08ec73dbe080b9ec56696ee21d32754d918
19 changes: 17 additions & 2 deletions trunk/drivers/tty/tty_ldisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include <linux/kmod.h>
#include <linux/nsproxy.h>
#include <linux/ratelimit.h>

/*
* This guards the refcounted line discipline lists. The lock
Expand Down Expand Up @@ -837,7 +838,7 @@ void tty_ldisc_hangup(struct tty_struct *tty)
tty_unlock();
cancel_work_sync(&tty->buf.work);
mutex_unlock(&tty->ldisc_mutex);

retry:
tty_lock();
mutex_lock(&tty->ldisc_mutex);

Expand All @@ -846,7 +847,21 @@ void tty_ldisc_hangup(struct tty_struct *tty)
it means auditing a lot of other paths so this is
a FIXME */
if (tty->ldisc) { /* Not yet closed */
WARN_ON_ONCE(tty_ldisc_wait_idle(tty, 5 * HZ));
if (atomic_read(&tty->ldisc->users) != 1) {
char cur_n[TASK_COMM_LEN], tty_n[64];
long timeout = 3 * HZ;
tty_unlock();

while (tty_ldisc_wait_idle(tty, timeout) == -EBUSY) {
timeout = MAX_SCHEDULE_TIMEOUT;
printk_ratelimited(KERN_WARNING
"%s: waiting (%s) for %s took too long, but we keep waiting...\n",
__func__, get_task_comm(cur_n, current),
tty_name(tty, tty_n));
}
mutex_unlock(&tty->ldisc_mutex);
goto retry;
}

if (reset == 0) {

Expand Down

0 comments on commit 96c7956

Please sign in to comment.