From: Hugh Dickins I get a hang at startup or shutdown: tiocsctty() holds tty_mutex, and now with Eric's tty-in-tiocsctty-when-we-steal-a-tty-hang-it-up.patch it can end up calling con_close(), which tries to take tty_mutex. So best revert that in hot-fixes, until Eric provides a better. Signed-off-by: Hugh Dickins Acked-by: Eric W. Biederman Signed-off-by: Andrew Morton --- drivers/char/tty_io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -puN drivers/char/tty_io.c~tty-in-tiocsctty-when-we-steal-a-tty-hang-it-up-fix drivers/char/tty_io.c --- a/drivers/char/tty_io.c~tty-in-tiocsctty-when-we-steal-a-tty-hang-it-up-fix +++ a/drivers/char/tty_io.c @@ -2980,7 +2980,9 @@ static int tiocsctty(struct tty_struct * /* * Steal it away */ - tty_vhangup(tty); + read_lock(&tasklist_lock); + session_clear_tty(tty->session); + read_unlock(&tasklist_lock); } else { ret = -EPERM; goto unlock; _