• A
    tty: avoid recursive BTM in pty_close · 11dbf203
    Arnd Bergmann 提交于
    When the console has been redirected, a hangup of the tty
    will cause tty_release to be called under the big tty_mutex,
    which leads to a deadlock because hangup is also called
    under the BTM.
    
    This moves the BTM deeper into the tty_hangup function so
    we can close the redirected tty without holding the BTM.
    In case of pty, we now need to drop the BTM before
    calling tty_vhangup.
    Signed-off-by: NArnd Bergmann <arnd@arndb.de>
    Acked-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
    11dbf203
tty_io.c 77.9 KB