summaryrefslogtreecommitdiff
path: root/kernel/lockdep_internals.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-10-03 21:44:21 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-10-12 12:40:05 -0700
commit4b5e77cb1f01c2eedbaa6979319a1c7a072ddedd (patch)
tree91fa84ed74c01550eba382fe4297e3a3e30566cd /kernel/lockdep_internals.h
parent1611e307ab917e66fce335dd57f45aee266614ee (diff)
downloadlwn-4b5e77cb1f01c2eedbaa6979319a1c7a072ddedd.tar.gz
lwn-4b5e77cb1f01c2eedbaa6979319a1c7a072ddedd.zip
tty: Avoid dropping ldisc_mutex over hangup tty re-initialization
commit 0b5759c654e74c8dc317ea2c6b3a7476160f688a upstream. A couple of people have hit the WARN_ON() in drivers/char/tty_io.c, tty_open() that is unhappy about seeing the tty line discipline go away during the tty hangup. See for example http://bugzilla.kernel.org/show_bug.cgi?id=14255 and the reason is that we do the tty_ldisc_halt() outside the ldisc_mutex in order to be able to flush the scheduled work without a deadlock with vhangup_work. However, it turns out that we can solve this particular case by - using "cancel_delayed_work_sync()" in tty_ldisc_halt(), which waits for just the particular work, rather than synchronizing with any random outstanding pending work. This won't deadlock, since the buf.work we synchronize with doesn't care about the ldisc_mutex, it just flushes the tty ldisc buffers. - realize that for this particular case, we don't need to wait for any hangup work, because we are inside the hangup codepaths ourselves. so as a result we can just drop the flush_scheduled_work() entirely, and then move the tty_ldisc_halt() call to inside the mutex. That way we never expose the partially torn down ldisc state to tty_open(), and hold the ldisc_mutex over the whole sequence. Reported-by: Ingo Molnar <mingo@elte.hu> Reported-by: Heinz Diehl <htd@fancy-poultry.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/lockdep_internals.h')
0 files changed, 0 insertions, 0 deletions