Commit 91bb1cf1 authored by Russell King's avatar Russell King Committed by Linus Torvalds

[PATCH] disassociate_ctty SMP fix

Ok, here's my proposed fix, which appears to work with preempt.  I haven't
tested on non-preempt, nor (obviously since its from me) SMP.  However,
I forsee no problems caused by this change.

release_dev() sets filp->private_data to NULL when the tty layer has
done with the file descriptor.  However, it remains on the tty_files
list until __fput completes.
parent b82507b1
...@@ -442,6 +442,13 @@ void do_tty_hangup(void *data) ...@@ -442,6 +442,13 @@ void do_tty_hangup(void *data)
file_list_lock(); file_list_lock();
for (l = tty->tty_files.next; l != &tty->tty_files; l = l->next) { for (l = tty->tty_files.next; l != &tty->tty_files; l = l->next) {
struct file * filp = list_entry(l, struct file, f_list); struct file * filp = list_entry(l, struct file, f_list);
/*
* If this file descriptor has been closed, ignore it; it
* will be going away shortly. (We don't test filp->f_count
* for zero since that could open another race.) --rmk
*/
if (filp->private_data == NULL)
continue;
if (IS_CONSOLE_DEV(filp->f_dentry->d_inode->i_rdev) || if (IS_CONSOLE_DEV(filp->f_dentry->d_inode->i_rdev) ||
IS_SYSCONS_DEV(filp->f_dentry->d_inode->i_rdev)) { IS_SYSCONS_DEV(filp->f_dentry->d_inode->i_rdev)) {
cons_filp = filp; cons_filp = filp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment