[PATCH] Fix SAK_work workqueue initialization.
Somewhere in the rewrite of the work queues my cleanup of SAK handling got broken. Maybe I didn't retest it properly or possibly the API was changing so fast I missed something. Regardless currently triggering a SAK now generates an ugly BUG_ON and kills the kernel. Thanks to Alexey Dobriyan <adobriyan@openvz.org> for spotting this. This modifies the use of SAK_work to initialize it when the data structure it resides in is initialized, and to simply call schedule_work when we need to generate a SAK. I update both data structures that have a SAK_work member for consistency. All of the old PREPARE_WORK calls that are now gone. If we call schedule_work again before it has processed it has generated the first SAK it will simply ignore the duplicate schedule_work request. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
552ce544ed
commit
7f1f86a0d0
@@ -3442,7 +3442,6 @@ void do_SAK(struct tty_struct *tty)
|
||||
{
|
||||
if (!tty)
|
||||
return;
|
||||
PREPARE_WORK(&tty->SAK_work, do_SAK_work);
|
||||
schedule_work(&tty->SAK_work);
|
||||
}
|
||||
|
||||
@@ -3568,7 +3567,7 @@ static void initialize_tty_struct(struct tty_struct *tty)
|
||||
mutex_init(&tty->atomic_write_lock);
|
||||
spin_lock_init(&tty->read_lock);
|
||||
INIT_LIST_HEAD(&tty->tty_files);
|
||||
INIT_WORK(&tty->SAK_work, NULL);
|
||||
INIT_WORK(&tty->SAK_work, do_SAK_work);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user