lkml.org 
[lkml]   [2003]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH][RESEND 3] 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.

--- orig/drivers/char/tty_io.c Fri Jan 17 10:39:10 2003
+++ linux/drivers/char/tty_io.c Wed Feb 5 16:38:23 2003
@@ -442,6 +442,13 @@
file_list_lock();
for (l = tty->tty_files.next; l != &tty->tty_files; l = l->next) {
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) ||
IS_SYSCONS_DEV(filp->f_dentry->d_inode->i_rdev)) {
cons_filp = filp;
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.076 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site