diff options
author | Nick Piggin <npiggin@suse.de> | 2008-06-06 01:46:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-06-06 14:29:12 -0400 |
commit | 81c6ce9bd3ed3a88caeb9ed97d874450d53339dc (patch) | |
tree | 90e93d92be9aa37fa003c37a3cd5da732d0d4882 /drivers/char/vt.c | |
parent | dfcceb26f89da86ec4ac9583c4515504af8c6c84 (diff) |
vt: fix vc_resize locking
Lockdep says we can't take tasklist lock or sighand lock inside ctrl_lock.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Acked-by: Alan Cox <alan@redhat.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/vt.c')
-rw-r--r-- | drivers/char/vt.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index b8b2498f57af..935f1c207a1f 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -909,7 +909,7 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines) | |||
909 | 909 | ||
910 | if (vc->vc_tty) { | 910 | if (vc->vc_tty) { |
911 | struct winsize ws, *cws = &vc->vc_tty->winsize; | 911 | struct winsize ws, *cws = &vc->vc_tty->winsize; |
912 | unsigned long flags; | 912 | struct pid *pgrp = NULL; |
913 | 913 | ||
914 | memset(&ws, 0, sizeof(ws)); | 914 | memset(&ws, 0, sizeof(ws)); |
915 | ws.ws_row = vc->vc_rows; | 915 | ws.ws_row = vc->vc_rows; |
@@ -917,11 +917,14 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines) | |||
917 | ws.ws_ypixel = vc->vc_scan_lines; | 917 | ws.ws_ypixel = vc->vc_scan_lines; |
918 | 918 | ||
919 | mutex_lock(&vc->vc_tty->termios_mutex); | 919 | mutex_lock(&vc->vc_tty->termios_mutex); |
920 | spin_lock_irqsave(&vc->vc_tty->ctrl_lock, flags); | 920 | spin_lock_irq(&vc->vc_tty->ctrl_lock); |
921 | if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) && | 921 | if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col)) |
922 | vc->vc_tty->pgrp) | 922 | pgrp = get_pid(vc->vc_tty->pgrp); |
923 | spin_unlock_irq(&vc->vc_tty->ctrl_lock); | ||
924 | if (pgrp) { | ||
923 | kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1); | 925 | kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1); |
924 | spin_unlock_irqrestore(&vc->vc_tty->ctrl_lock, flags); | 926 | put_pid(pgrp); |
927 | } | ||
925 | *cws = ws; | 928 | *cws = ws; |
926 | mutex_unlock(&vc->vc_tty->termios_mutex); | 929 | mutex_unlock(&vc->vc_tty->termios_mutex); |
927 | } | 930 | } |